[M3devel] on the lock free use of slots in Win32

Tony Hosking hosking at cs.purdue.edu
Mon Nov 23 00:51:23 CET 2009


On 22 Nov 2009, at 18:00, Jay K wrote:

> 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.

Agreed, but join is a heavy syncj anywau so who cares.

>  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?)

I *really* want the slots table only to contain the traced portion not the untraced.

>  
>  - Jay
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091122/27e72d32/attachment-0002.html>


More information about the M3devel mailing list