[Gc] about gc and pthread_win32

Romano Paolo Tenca rotenca at telvia.it
Tue May 15 10:16:15 PDT 2007


Boehm, Hans ha scritto:
> Good point.  It really should not make that assumption.  The down side
> is that there are serious difficulties with not making it, since I need
> to be able to hash on it, and I need to be able to generate an invalid
> thread id.  Also Linux seems to use a function call for pthread_equal.
>
> Based on a quick web search, it looks to me like the hashing problem is
> unavoidable, and this really can't be done portably without inventing a
> replacement notion of thread id.  Thus I'm inclined to just invent
> platform-dependent macros for (a) thread comparison (usually integer
> comparison, but pthread_equal where needed) and (b) mapping pthread_t to
> an identifying integer.  (Multiple threads may have the same associated
> identifying integer, though that should be rare.)
>
> Does that sound plausible?
>   
Yes to me.
I made something like that for 6.7 (where the problem was almost only 
the use of pthread_equal)
> This would need to be completed and checked by someone like you with
> easy access to a platform that uses a struct as pthread_t.
>   
I can test it under Mingw. (I need a makefile.direct. Configure does not 
work well in my system for unknown reasons).

In gc 6.7 most of Cygwin code for pthread works well under mingw and 
win32 ptread. The main problem was a new set of configure macro (i used 
something like GC_WIN32_PTHREAD) to use the same pthread code under 
Cygwin and Mingw.
> Hans
>
>   
-- 

Romano Paolo Tenca



More information about the Gc mailing list