Register for your free account! | Forgot your password?

You last visited: Today at 23:14

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Threading

Discussion on Threading within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #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.
BaussHacker is offline  
Old 11/18/2011, 10:06   #2
 
{ Angelius }'s Avatar
 
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
{ Angelius } is offline  
Old 11/18/2011, 11:54   #3


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
In terms of what exactly?
Korvacs is offline  
Old 11/18/2011, 18:09   #4
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Quote:
Originally Posted by Korvacs View Post
In terms of what exactly?
Handling players.
BaussHacker is offline  
Old 11/18/2011, 18:10   #5
 
Sp!!ke's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
global thread for all players.
Sp!!ke is offline  
Old 11/18/2011, 18:12   #6
 
_DreadNought_'s Avatar
 
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
_DreadNought_ is offline  
Old 11/18/2011, 18:15   #7
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Quote:
Originally Posted by _DreadNought_ View Post
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.
BaussHacker is offline  
Old 11/18/2011, 18:18   #8
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Wait for VS2012(or 2011) Does parallel code execution
_DreadNought_ is offline  
Old 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?
BaussHacker is offline  
Old 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.
pro4never is offline  
Thanks
1 User
Old 11/18/2011, 22:03   #11


 
Korvacs's Avatar
 
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..
Korvacs is offline  
Reply


Similar Threads 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.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.