|
You last visited: Today at 23:14
Advertisement
Threading
Discussion on Threading within the CO2 Private Server forum part of the Conquer Online 2 category.
11/18/2011, 09:27
|
#1
|
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
|
Threading
What should I do?
A thread for every map that's used by players, a global thread for all players or a single thread for every player.
|
|
|
11/18/2011, 10:06
|
#2
|
elite*gold: 0
Join Date: Aug 2010
Posts: 992
Received Thanks: 1,110
|
a thread pool with a max of 3/4 threads for all players
|
|
|
11/18/2011, 11:54
|
#3
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
In terms of what exactly?
|
|
|
11/18/2011, 18:09
|
#4
|
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
|
Quote:
Originally Posted by Korvacs
In terms of what exactly?
|
Handling players.
|
|
|
11/18/2011, 18:10
|
#5
|
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
|
global thread for all players.
|
|
|
11/18/2011, 18:12
|
#6
|
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
|
Dont even think about thread per player.
Because I will personally delete your entire source. <3
|
|
|
11/18/2011, 18:15
|
#7
|
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
|
Quote:
Originally Posted by _DreadNought_
Dont even think about thread per player.
Because I will personally delete your entire source. <3
|
I wasn't going to do that anyways, it sounds **** IMO. Just want to know if I should assign a thread for the maps in use by players or just one global, but it's just it sounds like the global one will make delays, because it will handle one player and then another player after, where a thread for the single maps would be faster, instead it loop through maybe 500 players, then only 50 or 100 etc. I'm a bit clueless at this, but want whatever that's best.
|
|
|
11/18/2011, 18:18
|
#8
|
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
|
Wait for VS2012(or 2011) Does parallel code execution
|
|
|
11/18/2011, 18:20
|
#9
|
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
|
I will switch to that then, but what about now?
|
|
|
11/18/2011, 18:36
|
#10
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
You need to think about this in terms of function rather then collections.
You say threads to deal with players but deal with WHAT exactly?
Stamina/xp bar? Auto attack? etc.
I'd have threads for each FUNCTION personally but that's just me and then make sure my player collection was going to be threadsafe to make sure it works properly (IE: ConcurrentDictionary).
As for packet handling I'd use a threadpool to deal with that and then a few threads to deal with basic server actions.
|
|
|
11/18/2011, 22:03
|
#11
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
pro kinda summed up what i was getting at, handling players could mean anything..
|
|
|
 |
Similar Threads
|
Multi Threading
08/18/2011 - CO2 Private Server - 6 Replies
I know it's not Conquer related like that, but Multi Threading is a very big part, when developing Conquer PServers.
Source: Managed Threading Best Practices
|
Socket/Threading Question
07/31/2011 - CO2 Programming - 3 Replies
Alright so I've been following InfamousNoone's C# for idiots tutorial (video set) and I've just finished watching them all. I can now say I'm very very interested in sockets and whatnot. So the problem is, I'm trying to use sockets to creating a mini Messaging client and I've gotten to the point where I can send a message back in forth. But this is how it works.
The ONLY way you can send a message is if you receive one first. That's obviously a problem! I've tried to start multiple threads...
|
[C++] Problem with threading
05/17/2009 - CO2 Programming - 2 Replies
Actually the problem is more like with passing a function as pointer to the CreateThread or _beginthreadex,
BOOL Connect()
{
if(m_Enabled != TRUE)
return FALSE;
sockaddr_in addr;
addr.sin_family = AF_INET;
|
[C#] Cross-Threading ?
10/14/2008 - .NET Languages - 7 Replies
Hello,
Is there a flag or whatever that lets me use crossthreading freely? Without the help of a Workerthread. Whenever I try to change a variable it doesn't let me because Crossthreading isn't safe (eg. accessing the variables from other threads), but It's also hard to find a solution for this.
I'm starting another thread that contains a function to download the source code of another page and process the wanted information into variables, however I cannot do that with a thread. The only...
|
All times are GMT +1. The time now is 23:15.
|
|