[M3devel] Latest pthreads attempt

mika at async.caltech.edu mika at async.caltech.edu
Wed Aug 13 00:12:09 CEST 2014


Tony,

I've been reading a bit of the pthread code and I have a question...

What if one were to write a ThreadPThread that is a very thin veneer
over pthreads?  What goes wrong?  That is, simply translate Modula-3
calls Thread.Acquire to pthread_lock(...), Modula-3 condition variables
to pthread condition variables, etc.

I know Alerted is a bit different but it's cooperative: both the waiter
and alerter know they are going to be Alerted (so it could be less 
efficient and have extra data structures).

Would there be issues with the garbage collector?  Some inefficiency?

I think I am mainly worried about the presence of "GetActivation()"
in critical places like LockMutex and UnlockMutex.  Maybe it's not a
big deal anymore...(it used to be a real drag at least on FreeBSD
because it involved a system call).

     Mika




More information about the M3devel mailing list