Boost logo

Threads-Devel :

From: Anthony Williams (anthony_at_[hidden])
Date: 2006-04-03 11:08:52


Roland Schwarz <roland.schwarz_at_[hidden]> writes:

> Anthony, It would be fine if you could take a look at this one:
>
> https://sourceforge.net/tracker/index.php?func=detail&aid=568951&group_id=7586&atid=107586
>
> Al though it is a rather dated "bug", I am not sure if it still applies.
> At least the mingw build works on my machine. However since I also have
> the other compiler (msvc) still installed I do not know if this is
> silently working altough it should not.
>
> It would be helpful if you could investigate the situation so we can
> close the bug.

I have added a comment. I believe we can close this bug.

> The other one is the missing patch for the tss stuff:
> https://sourceforge.net/tracker/index.php?func=detail&aid=1424965&group_id=7586&atid=107586
>
> I am afraid however that this really belongs to me as I was engaged in
> tss at that time. Nevertheless I would be glad if you could take a look
> on it too.

OK.

> The third issue on windows is the missing #pragma stuff for the
> Interlocked* functions in once.cpp on th 64 bit platform. Since you
> already rewrote the once for thread_rewrite, could you possibly make an
> educated guess of how to cleanly handle this case?

I discovered that I do have a 64-bit compiler, since it comes with the
Platform SDK, though I don't have a 64-bit system to test on. However, I can
reproduce the problem.

As far as I can see, the problem arises because _InterlockedCompareExchange is
not declared in the library for AMD64/IA64, but is purely a compiler
intrinsic. The code in once.cpp that tries to pass it through a function
pointer therefore fails, as it can't find the external symbol to link to.

I'm inclined to think that this is a bug in the Platform SDK, rather than in
Boost, since there's nothing in the docs that says you can't take the address
of the function.

Anyway, the fix does indeed seem to be to replace the ice_wrapper stuff with a
direct call to InterlockedCompareExchange. It will need testing on older
compilers, but it seems to work without any errors or warnings on g++(mingw)
4.0.1, VC 7.1 (13.10.3052), VC 8.0 (14.00.50727.42), and VC 14.00.40310.41
(platform SDK 64-bit compiler)

I hope sourceforge get CVS back up and running soon, I've got several things I
want to check in.

Anthony

-- 
Anthony Williams
Software Developer
Just Software Solutions Ltd
http://www.justsoftwaresolutions.co.uk

Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk