lua-users home
lua-l archive

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


re:

You say there is a 'lua-lanes'-like mode of operation, does it mean
that I can something like this?

local tuna = require 'tuna'
local thread = tuna.startThread('*')
local task = thread:startTaskFromBuffer(.....)

This was easier than I thought it would be, after a few hours of research:

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require 'tuna'
> thread = tuna.startThread('*')
> thread.startTaskFromFile( "examples/test.lua", "tester" )
> into test
slept
slept
slept

examples/test.lua:
function tester()
    print( "into test" )
    while 1 do
        print( "slept" )
        tuna.sleep( 1000 )
    end
end

So expect tuna 0.4.2 with "tuna.so" available to run all of Tuna's functionality entirely from lua. I can release it now [privately] to anyone who wants to test it but it won't be up on the site until it's quite a bit more polished, with some examples/docs, and working for Win32/64 as well.

I do need some advice though: I have *NEVER* tried to publish a shared library, particularly for *nix. Right now it just builds/links tuna.so very naively:

tuna.so: $(LOBJS)s
g++ -shared -Wl,-soname,libtuna.so.1 -o tuna.so -lc $(LOBJS) -lpthread -lrt -llua

and that works fine if you run lua from the same directory, but I don't know what the standards are for locating/naming it on a standard system. Any help/guidance would be much appreciated. like shouldn't I call it libtuna.so.0.4.2 or something? and put it into /usr/lib or /usr/lib64 with an install script?

Just a pointer to a tutorial or FAQ-for-dummies would be fine, I've been googling for the last 20 minutes and have nothing but a headache to show for it.

-Curt