[M3devel] on the lock free use of slots in Win32
Jay K
jay.krell at cornell.edu
Mon Nov 23 00:00:42 CET 2009
Just fyi Tony, in Win32, we call Self() frequently -- for every lock/unlock. On Pthread we call Self() rarely -- your recent change.
My change removes the locking in Win32 Self().
Very soon I'll try to make Win32 like Pthread -- moving most of the state from the traced T to the untraced Activation, thereby removing nearly all calls to Self(), its locking therefore rare, then go back to being like pthread and not being lock-free.
It is tempting to use a rwlock, except I noticed a very direct statement in pthread docs that rwlock is slower than mutex.
Maybe we can write one that is faster but for now..
I'm still not keen on the global joinMu..any overly large lock..but I think it is valuable to have Win32 threads and pthreads be more similar than different and I'll end up with it.
Another change to consider, but I suspect it is terrible perf, is change the thread local to just be the index into slots.
That way there aren't the two split records.
But that probably involves adding a lot of traced references back to where they aren't and would be very very bad?
(perf, and circularities within gc?)
- Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091122/470d2bf7/attachment-0001.html>
More information about the M3devel
mailing list