From 1038af6d16f53c2f2461c62e145a7321f17fe04f Mon Sep 17 00:00:00 2001 From: "Robert G. Jakabosky" Date: Thu, 24 Mar 2011 06:20:29 -0700 Subject: [PATCH] Added missing dependency. Fix thread latency perf benchmark. --- README.md | 4 ++++ perf/thread_lat.lua | 8 ++++---- rockspecs/lua-zmq-threads-scm-0.rockspec | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 750f204..e33a6f5 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ Installation With LuaRocks 2.0.4.1: $ sudo luarocks install https://github.com/Neopallium/lua-zmq/raw/master/rockspecs/lua-zmq-scm-1.rockspec +For threads support: + $ sudo luarocks install https://github.com/Neopallium/lua-llthreads/raw/master/rockspecs/lua-llthreads-scm-0.rockspec + $ sudo luarocks install https://github.com/Neopallium/lua-zmq/raw/master/rockspecs/lua-zmq-threads-scm-0.rockspec + With CMake: $ git clone git://github.com/Neopallium/lua-zmq.git $ cd lua-zmq ; mkdir build ; cd build diff --git a/perf/thread_lat.lua b/perf/thread_lat.lua index c307776..a0ea65a 100644 --- a/perf/thread_lat.lua +++ b/perf/thread_lat.lua @@ -29,7 +29,7 @@ local message_size = tonumber(arg[3]) local roundtrip_count = tonumber(arg[4]) local zmq = require"zmq" -local thread = require"zmq.thread" +local zthreads = require"zmq.threads" local socket = require"socket" local time = socket.gettime @@ -39,9 +39,9 @@ local child_code = [[ print("child:", ...) local zmq = require"zmq" - local thread = require"zmq.thread" + local zthreads = require"zmq.threads" - local ctx = thread.get_parent_ctx() + local ctx = zthreads.get_parent_ctx() local s = ctx:socket(zmq.REP) s:connect(connect_to) @@ -60,7 +60,7 @@ local ctx = zmq.init(1) local s = ctx:socket(zmq.REQ) s:bind(bind_to) -local child_thread = thread.runstring(ctx, child_code, connect_to, message_size, roundtrip_count) +local child_thread = zthreads.runstring(ctx, child_code, connect_to, message_size, roundtrip_count) child_thread:start() local data = ("0"):rep(message_size) diff --git a/rockspecs/lua-zmq-threads-scm-0.rockspec b/rockspecs/lua-zmq-threads-scm-0.rockspec index bc7b0f0..e726f3c 100644 --- a/rockspecs/lua-zmq-threads-scm-0.rockspec +++ b/rockspecs/lua-zmq-threads-scm-0.rockspec @@ -10,6 +10,7 @@ description = { } dependencies = { "lua-zmq", + "lua-llthreads", } build = { type = "none",