[Mono-list] posix-threads vs mono-threads

caster@lagash.com caster@lagash.com
Fri, 20 Jul 2001 01:59:45 -0300


I've been doing some research in order to contribute to the 
threading and synchronization support, including the classes 
in the System.Threading namespace.

I would like to get some opinions from you guys regarding 
this: should be count on "pthreads" being present on the system, 
and just write wrappers to the pthread functions using pinvoke?
Is it better to write a small set of functions in C and call
those from pinvoke, hiding platform differences in the C code?

Things can get tricky with the "wrap pthreads" approach, because
some abstractions such as CompareExchange or rw-locks are not 
necesary exposed by all pthreads implementations. Of course you
can implement all this stuff using just mutexes, but that would
be too slow.

On the other hand, writing C functions will require them to live
in a library (may be in corlib and declared as "internalcall").

I would apreciate some feedback on this before I start writing...
thanks ;-)

Caster.