[Mono-list] Intrinsicly Non-Portable?

Dick Porter dick@ximian.com
Fri, 23 Nov 2001 23:43:04 +0000


On Sat, Nov 24, 2001 at 12:23:59AM +0200, Serge wrote:
> I also think that some pieces are hard to implement efficiently yet
> portable, Threading.Interlocked for example - implemented with mutex it's
> surely less efficient.

I think a pthread spinlock would do nicely here.

A lot of the win32 API maps reasonably cleanly to a pthreads implementation.
The only really hairy part is waiting for multiple objects at once, 
especially where you need to return all or nothing.  I've just realised
that I don't cope with the case where multiple types are being waited for,
the waitall flag is TRUE, and only one type of handle satisfies the wait :-(
(Each type of handle is waited for separately).


- Dick