lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


 > On Tue, 09 Dec 2008 20:16:15 -0500 (EST)
 >   nr@cs.tufts.edu (Norman Ramsey) wrote:
 > > I haven't had much luck with search engines or 
 > > Luaforge---does anybody
 > > happen to have Lua bindings for Posix semaphores?  

 > Do you need it for interacting with some non-Lua code 
 > (which is already using semaphores) or just for managing 
 > multithreading?

It needs to interact with non-Lua code, but that code is not already
using semaphores.

 > If the latter, try i.e. Lanes.
 > 
 > http://luaforge.net/forum/forum.php?forum_id=1781

I had a look and it seems to be a nice project.
However, I have never been terribly comfortable with Linda tuple space
(although I am quite impressed with the use you have put it to here).

I have instead decided on a simpler solution:
  * Write bindings for POSIX named semaphores
  * Implement an atomic queue in Lua
  * Write shell scripts atomic-get-line and atomic-put-line
I now have a very simple, useful system for spreading work over
multiple cores and multiple hosts.   There are some ugly spots I wish
to scrub away, but if Luiz will ask me in six weeks, I will post the
code :-)


Norman