Multithreading
by Mak Andrew · in Torque Game Engine · 01/18/2005 (4:39 pm) · 27 replies
Hi,
Currently, i'm trying to create a separated thread to pull data from the database(using MySQL) and then update the object pos in torque engine
In the separate thread, i have a loop that pull data from the database. For the first few loop, every things is just fine, however as the loop process, the pulling of data fail. However when i do these in single thread, the engine works perfectly.
i realise that there's a class "Thread", that do multithreading
HELP???!!!
Currently, i'm trying to create a separated thread to pull data from the database(using MySQL) and then update the object pos in torque engine
In the separate thread, i have a loop that pull data from the database. For the first few loop, every things is just fine, however as the loop process, the pulling of data fail. However when i do these in single thread, the engine works perfectly.
i realise that there's a class "Thread", that do multithreading
HELP???!!!
About the author
#22
Would it be more than moderately painful to break out what is required to handle the mission host into a thread and then start a thread pool that can swap out missions as required? Basically, I would like to run the system as Neverwinter Nights, but with each "Area" represented by a mission. The reason for having the ability to host multiple missions is that with multiple players each player could concievably be in different areas at the same time.
Or am I swatting flies with nukes?
11/06/2005 (9:34 pm)
I have a question - I want to run a dedicated server that could host multiple missions from the same main process. I would need to be able to allow players to move from one mission to another and to be able to have a mission started up on demand by a trigger in another mission.Would it be more than moderately painful to break out what is required to handle the mission host into a thread and then start a thread pool that can swap out missions as required? Basically, I would like to run the system as Neverwinter Nights, but with each "Area" represented by a mission. The reason for having the ability to host multiple missions is that with multiple players each player could concievably be in different areas at the same time.
Or am I swatting flies with nukes?
#23
That would be basically insane; why not just run multiple Torque servers and have players switch between them? It would behave almost exactly the same and require several man-months less work. ;)
11/07/2005 (2:14 am)
You should really have started a new thread for this rather than reviving one from months ago. :)That would be basically insane; why not just run multiple Torque servers and have players switch between them? It would behave almost exactly the same and require several man-months less work. ;)
#24
Indeed, there is still work to do, but you're definitely right in that it's far less work....
And I'm sorry to have dredged up this old thread, but I was reading along and thought I'd ask - without looking at the post dates. Oops....
11/08/2005 (6:14 pm)
Ok, so I could set up to spawn multiple servers, and have them wait "empty" until a specific "area" is requested. Then load the requested "area" in the first available server and jump the player to it. If another player requests the same "area" the server has to recognise that there is another server with that 'area' already loaded and jump the next player to it.Indeed, there is still work to do, but you're definitely right in that it's far less work....
And I'm sorry to have dredged up this old thread, but I was reading along and thought I'd ask - without looking at the post dates. Oops....
#25
11/09/2005 (11:10 am)
Or, just have one server start for each of the missions you have (even if no one is "in" the mission), and have a standalone "server manager" app that keeps track of which missions each server runs, and what their socket (or ip:socket in the case of using multiple server computers) info is for the reconnect.
#26
Perhaps the server manager should be responsible for properly loading/unloading/maintaining the various servers, while keeping a relatively small pools of "sub-servers" (for lack of a better term.
11/15/2005 (5:52 pm)
Not a chance - ever played Neverwinter Nights? Each "module" is composed of 5~500 areas. While it'd work ok for up to, say, 30 or so after that it'd get really boggy.Perhaps the server manager should be responsible for properly loading/unloading/maintaining the various servers, while keeping a relatively small pools of "sub-servers" (for lack of a better term.
#27
11/18/2005 (10:31 am)
@Richard: that is an excellent optimized strategy as well, assuming that you have some form of predictive scheduling so that the player won't have to wait for the server to instantiate the next mission before being able to move into it. Some form of prediction based on "ok, a player is one zone away from a zone that isn't up and running yet, so let's start it up" type of thing would probably work as a start.
Torque Owner Vince Gee
Winter Leaf Entertainment