Lua bindings for Posix semaphores?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua bindings for Posix semaphores?

Norman Ramsey
I haven't had much luck with search engines or Luaforge---does anybody
happen to have Lua bindings for Posix semaphores?  If not and I get
around to writing some, Luiz will remind me to post...


Norman


P.S. This mail is being sent to you automatically.  I learned that outgoing email
on my new laptop has been silently discarded since I first started it up on October
6.  I am re-sending all the old mail, but this mail my no longer be timely, in 
which case please ignore it with my blesssings.  ---Norman

Reply | Threaded
Open this post in threaded view
|

Re: Lua bindings for Posix semaphores?

Asko Kauppi

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

If the latter, try i.e. Lanes.

http://luaforge.net/forum/forum.php?forum_id=1781

-asko


On Tue, 09 Dec 2008 20:16:15 -0500 (EST)
 [hidden email] (Norman Ramsey) wrote:
I haven't had much luck with search engines or Luaforge---does anybody happen to have Lua bindings for Posix semaphores? If not and I get
around to writing some, Luiz will remind me to post...


Norman


P.S. This mail is being sent to you automatically. I learned that outgoing email on my new laptop has been silently discarded since I first started it up on October 6. I am re-sending all the old mail, but this mail my no longer be timely, in which case please ignore it with my blesssings. ---Norman


Reply | Threaded
Open this post in threaded view
|

Re: Lua bindings for Posix semaphores?

Norman Ramsey
 > On Tue, 09 Dec 2008 20:16:15 -0500 (EST)
 >   [hidden email] (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