I didn't fail to see it, I just didn't know if zac wanted to use LÖVE.bartbes wrote:I wonder how you guys fail to see it as easy as it is:
How do you use threads?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: How do you use threads?
Help us help you: attach a .love.
Re: How do you use threads?
I had no idea that existed. It's not in 0.6.2 and not included in the love module's index on the Wiki. Are you guys all using 0.7?bartbes wrote:I wonder how you guys fail to see [..] .thread.newThread("input", "input.lua")
A simply console interface for debugging? That's what I assumed.bartbes wrote:I have no idea why you would want to do this.
Re: How do you use threads?
Yeah it's introduced in 0.7.0. It's on the wiki, just not in the sidebar.Mud wrote: I had no idea that existed. It's not in 0.6.2 and not included in the love module's index on the Wiki. Are you guys all using 0.7?
debug.debug()A simply console interface for debugging? That's what I assumed.
Re: How do you use threads?
Ahh, very nice.debug.debug()
Re: How do you use threads?
Because you need to receive command input from a user and run your server's physics and other services simultaneously... And doing that from a graphical input is not only laggy, but a pain to code...bartbes wrote: That being said, I have no idea why you would want to do this.
debug.debug() is almost identical to:Mud wrote:Ahh, very nice.debug.debug()
Code: Select all
debug=function()
while true do
local s=io.stdin:read()
if s=="cont" then break end
local f,e=loadstring(s)
assert(f,e)
assert(pcall(f))
end
end
Hello, I am not dead.
Re: How do you use threads?
You're writing a server in LÖVE? That doesn't sound very efficient to me.zac352 wrote:Because you need to receive command input from a user and run your server's physics and other services simultaneously... And doing that from a graphical input is not only laggy, but a pain to code...
You should just write it in pure Lua. I know I've seen a Box2D library for Lua somewhere...
Re: How do you use threads?
Why would I use box2d? We don't get along well.thelinx wrote:You're writing a server in LÖVE? That doesn't sound very efficient to me.zac352 wrote:Because you need to receive command input from a user and run your server's physics and other services simultaneously... And doing that from a graphical input is not only laggy, but a pain to code...
You should just write it in pure Lua. I know I've seen a Box2D library for Lua somewhere...
And besides that, how do you use threads in regular lua?
Hello, I am not dead.
Re: How do you use threads?
You find a thread library for Lua. I don't know any off-hand, so try googling around.
Re: How do you use threads?
The best thing I've found is POSIX only. >_<thelinx wrote:You find a thread library for Lua. I don't know any off-hand, so try googling around.
Edit: I've found some stuff about "LuaThread", but I can't find any page for it.
Hello, I am not dead.
Who is online
Users browsing this forum: No registered users and 15 guests