[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: another try at multithreading
- From: "Alex Davies" <alex.mania@...>
- Date: Thu, 19 Jun 2008 13:29:06 +0800
Javier Guerra wrote:
So, i'm exploring the opposite direction: lock-free structures. so
far, i have a simple lockfree hashtable with similar semantics to Lua
tables. I'd like to put it somewhere (LuaForge? this list? it's just
a 4.6kb tgz) to start some discussions.
I would be interested to see it. As tables are used throughout Lua for all
tasks may actually be feasible. The GC's atomic phase would still have to
block, as it traverses the stack, but other then that lockfree tables may
well work. Does even len work? I suppose the only real concern would be
speed (quite a big concern) and possibly table size...
About locks though, they can be just a single bit if there's no need to nest
them (there shouldn't be any need in Lua), so it may still be worth trying
that approach too.
And later versions of LuaJIT may take a third approach:
(Only lock when needed)