PtokaX forum

Development Section => Your Developing Problems => Topic started by: NightLitch on 14 July, 2004, 14:55:14

Title: *** MultiThreading Help
Post by: NightLitch on 14 July, 2004, 14:55:14
Hey you all expecienced lua scripters/programmers.

Anyone that can help out 2 understand MultiThreading or give me a page about it plz...

/NL
Title:
Post by: plop on 14 July, 2004, 17:25:53
click (http://www.google.nl/search?q=lua+multi+threading&ie=ISO-8859-1&hl=nl&btnG=Google+zoeken&lr=)

plop
Title:
Post by: tezlo on 14 July, 2004, 17:30:28
nothing to do with lua..
basically, multithreading is the ability of an operating system to execute different parts of a program (threads) simultaneously
edit.. lol plop :) indeed you're best off asking google
Title:
Post by: NotRabidWombat on 14 July, 2004, 17:38:18
Coroutines
http://www.inf.puc-rio.br/~roberto/docs/corosblp.pdf
http://lua-users.org/wiki/CoroutinesTutorial
http://www.lua.org/manual/5.0/manual.html

LuaThreads
http://www.tecgraf.puc-rio.br/~diego/luathreads/

All of this is lua 5.x only.

-NotRabidWombat
Title:
Post by: NightLitch on 14 July, 2004, 18:11:43
Some other than me feels like trying 2 create an exampel for say server/client?

Wombat could you maybe compile the LuaThreads for me plz, maybe that is some simpler than Coroutines maybe... Am stuck where I am now...

trying 2 figuring out how Coroutines works but hard when I don't know what every english word means...

/NL
Title:
Post by: NightLitch on 14 July, 2004, 18:16:26
I Just read about LuaThreads AND I must say, that would surely be easier than Coroutines just by looking at it... lol

plz compile it for me, due because I don't now how 2 compile...

/NL
Title:
Post by: [NL]Pur on 14 July, 2004, 18:49:05
Quote
nothing to do with lua..
basically, multithreading is the ability of an operating system to execute different parts of a program (threads) simultaneously
edit.. lol plop :) indeed you're best off asking google


i always thought multithreading was the ablility of an operating system to execute, different programs at the same time.
Title:
Post by: NightLitch on 14 July, 2004, 18:54:49
or diff. functions that make the gui or hub frezze...

plzplz compile LuaThreads for me...

/NL
Title:
Post by: Herodes on 14 July, 2004, 19:15:31
Quote
Originally posted by [NL]Pur
i always thought multithreading was the ablility of an operating system to execute, different programs at the same time.

my brain says 99% chances this is multitasking ... loly :)
Title:
Post by: kepp on 14 July, 2004, 19:19:31
Actually night, I do not belive you need Coroutines nor MultiT.

A socket shall not freeze an entiry program unless you handle it wrong.
Title:
Post by: NotRabidWombat on 14 July, 2004, 19:39:50
"I Just read about LuaThreads AND I must say, that would surely be easier than Coroutines just by looking at it... lol

plz compile it for me, due because I don't now how 2 compile..."

I'm not convinced this will be easier in the long run. When you have real threads you must now be concerned with thread safety. You will have to ensure you so not operate on data that the other thread could be operating on.
I'll see what I can do anyway. In the meantime, coroutines are your best choice.

"Actually night, I do not belive you need Coroutines nor MultiT.

A socket shall not freeze an entiry program unless you handle it wrong."

Socket communication always works best with additional threads because of timeouts and listening.

-NotRabidWombat
Title:
Post by: NightLitch on 14 July, 2004, 20:10:21
Quote
Originally posted by kepp
Actually night, I do not belive you need Coroutines nor MultiT.

A socket shall not freeze an entiry program unless you handle it wrong.

If so, just you try create a simple script trying just 2 get $Lock from ptokax or something... I on the edge on frustration now... heheh...

Quote
Originally posted by NotRabidWombat
I'm not convinced this will be easier in the long run. When you have real threads you must now be concerned with thread safety. You will have to ensure you so not operate on data that the other thread could be operating on.
I'll see what I can do anyway. In the meantime, coroutines are your best choice. "
Ok. Well I hope I can learn something then... Am real stuck...

Without help I don't now what/where 2 begin...

/NL



/NL
Title:
Post by: VidFamne on 15 July, 2004, 02:49:19
Talking about threads. Is there anybody who knows
how many threads Ptokax is running?
Title:
Post by: [NL]Pur on 15 July, 2004, 11:30:58
Quote
If so, just you try create a simple script trying just 2 get $Lock from ptokax or something... I on the edge on frustration now... heheh...


you can't get the $Lock thru scripting with ptokax.
Title:
Post by: NightLitch on 15 July, 2004, 13:59:46
Quote
Originally posted by [NL]Pur
Quote
If so, just you try create a simple script trying just 2 get $Lock from ptokax or something... I on the edge on frustration now... heheh...


you can't get the $Lock thru scripting with ptokax.

ehm... yeah I now that... but this is for my gui so I can connect with it 2 ptokax... =) get it now ?

But I can understand Coroutines...

/NL
Title:
Post by: [NL]Pur on 15 July, 2004, 16:03:32
well, this the first time you mention it in this thread that you want to create non blocking sockets with lua.

But aren't you going a bit overkill with everything :/

I mean there are easier/better solutions available.
Title:
Post by: NightLitch on 15 July, 2004, 20:46:08
Quote
Originally posted by [NL]Pur
well, this the first time you mention it in this thread that you want to create non blocking sockets with lua.

But aren't you going a bit overkill with everything :/

I mean there are easier/better solutions available.

Am lua Freaking OUT here... lmao... Gonna try learn some basic C++ or VB where I can create a GUI that can connect as a Client 2 ptokax hub.

I want 2 catch all logs realtime...

/NL
Title:
Post by: NotRabidWombat on 15 July, 2004, 21:40:41
"Talking about threads. Is there anybody who knows
how many threads Ptokax is running?"

TestDrive 4 - Three.

-NotRabidWombat
Title:
Post by: Corayzon on 16 July, 2004, 08:03:43
yo night,

what exactly do you need help with?

cause you talk about program threading help and then you say your tring to write a protax hub client to connect to your hubscript?

how do these relate?

i fink if ya clearly state what u need to accomplish then maybe ppl can help alot quicker, rather then just asking for help on what you think might be the solution to your problem.

if ya need some help with vb or c# socket programing i would be glade to help ya out. i would have now, but i dont seem to see what ur asking on help with

me shutup now  :rolleyes:

noza
Title:
Post by: NightLitch on 16 July, 2004, 12:52:54
Well for the moment I have created my Own GUI in WxLua work great no bugs nothing.

My next movement I though would be if I could make the Gui connect 2 ptokax so I can have it on there and gather online information, such as: Realtime UserInfo database to look in, in Gui.

2 My problem/help then, I want 2 be able 2 connect 2 ptokax in some with my gui mostly then, I've read that you can implent C code into lua but I don't know how that works, though if I could get help with the socket and datareturning then Am happy...

But I don't now how to do it, anf it feels like wasted time for the moment trying 2 learn C++ or VB.

All help and solusions are welcome.

/NL
Title:
Post by: Corayzon on 22 July, 2004, 03:22:24
yo NightLitch,

i see. This could be done like so...

u can have a administration bot that connects to your hub the same way you would. and have extra protocol added to handle administrating the hub.

one thing that might help ya is my appserver mainframe. Its writin in vb and contains the p2p protocol handlers (lock to key and so on) and has side scripts implemented for various winstock functions.

another way would to be simply write a admin mode for your bot in ptokax. ie, type +admin and have ur bot open admin mode to your user.

hope this gives ya some ideas NightLitch

noza