Re[3]: [Gc] Fix for Win32 PARALLEL_MARK

Ivan Maidanski ivmai at mail.ru
Wed Nov 12 16:08:59 PST 2008


Hi!

Hans Boehm <Hans.Boehm at hp.com> wrote:
> On Wed, 12 Nov 2008, Ivan Maidanski wrote:
>
> > Hi!
> >
> > "Boehm, Hans" <hans.boehm at hp.com> wrote:
> >>
> >> 1) I think we need a definition of AO_ASSUME_WINDOWS98 if we're on
> >> Windows and PARALLEL_MARK is defined.  Otherwise we get a correct
> >> complaint that CAS isn't available.
> >
> > -DAO_ASSUME_WINDOWS98 should be added to VC++ build scripts only. I
> > don't think it's correct to add it to some header file.
>
> I'd be inclined to define it in gcconfig.h when PARALLEL_MARK is defined.
> I think mark.c still needs compare_and_swap, so we would have to
> document that the PARALLEL_MARK version doesn't work on Windows 95,
> which seems OK.  My impression is that this is not compiler specific?
> It's a question of a missing routine in the runtime library for cmpxchg?
> Thus it doesn't seem right to handle this in a VC++ script?

Well, I agree with You (because it's not an API call on modern compilers - it's intrinsic).
With the same result we may throw -DAO_ASSUME_WINDOWS98 away from libatomics.
On the other hand, formally, -DAO_ASSUME_WINDOWS98 is required only for x86 and VC++ (non-GNU to be correct), so it's not a big deal to add it VC++ scripts.
So, do it yourself as you wish. Note also, that we already have REQUIRE_CAS defined in gcconfig.h.

But don't add a comment that an app compiled with PARALLEL_MARK would not run on Win95 - it works (should work but not really tested, tested only on Win98 under vmware) correctly (unless the compiler doesn't support intrinsic for CAS and turns it into an API call) with parallel marking automatically turned off at runtime (AFAIK, all non-NT Windows systems didn't support multi-CPU).

> ...
>
> Hans
>

Bye.


More information about the Gc mailing list