On Tue, Nov 15, 2011 at 5:04 PM, Benoit Germain
<bnt.germain@gmail.com> wrote:
I've checked with lanes HEAD, and it works as expected, all threads
are run concurrently. You seem to be running a lanes-2.x version. I am
pretty sure it should behave the same though. Here is what I get:
local lanes = require "lanes".configure(1)
print( os.date())
lanes.gen("os,base", function() os.execute('sleep 10 && echo
finished_sleeping') print( os.date()) end)()
lanes.gen("os,base", function() os.execute('sleep 10 && echo
finished_sleeping') print( os.date()) end)()
lanes.gen("os,base", function() os.execute('sleep 10 && echo
finished_sleeping') print( os.date()) end)()
lanes.gen("os,base", function() os.execute('sleep 10 && echo
finished_sleeping') print( os.date()) end)()
->
> dofile "lanes_test.lua"
11/15/11 17:02:26
> finished_sleeping
finished_sleeping
finished_sleeping
11/15/11 17:02:36
11/15/11 17:02:36
finished_sleeping
11/15/11 17:02:36
11/15/11 17:02:36
Hi Benoit,
I'm had lanes 2.1.1 installed on OSX. The configure options doesn't seem to be available so I did a plain require. The output is different from yours:
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> dofile "test_lanes.lua"
Tue Nov 15 20:13:02 2011
> finished_sleeping
Tue Nov 15 20:13:12 2011
finished_sleeping
Tue Nov 15 20:13:22 2011
finished_sleeping
Tue Nov 15 20:13:32 2011
finished_sleeping
Tue Nov 15 20:13:42 2011
I did a reinstall with luarocks but I get the same output. Can I make luarocks install the HEAD version? Below is my build output.
Thijs
cd src && make LUAROCKS=1 CFLAGS="-O2 -fPIC -I/myroot/include" LIBFLAG="-bundle -undefined dynamic_lookup -all_load" LUA=lua LUAC=luac
lua ../tools/bin2c.lua keeper.lua -o keeper.lch
export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 -fPIC -I/myroot/include -c -o lanes.o lanes.c
export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 -fPIC -I/myroot/include -c -o threading.o threading.c
export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 -fPIC -I/myroot/include -c -o tools.o tools.c
export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 -fPIC -I/myroot/include -c -o keeper.o keeper.c
export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -bundle -undefined dynamic_lookup -all_load lanes.o threading.o tools.o keeper.o -o lua51-lanes.so
mkdir -p /myroot/lib/luarocks/rocks/lanes/2.1-1/lib /myroot/lib/luarocks/rocks/lanes/2.1-1/lua
install -m 644 src/lua51-lanes.so /myroot/lib/luarocks/rocks/lanes/2.1-1/lib
cp -p src/lanes.lua /myroot/lib/luarocks/rocks/lanes/2.1-1/lua
Updating manifest for /myroot/lib/luarocks/rocks
lanes 2.1-1 is now built and installed in /myroot (license: MIT/X11)