LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 01-29-2007, 08:31 PM   #1
md_lasalle
LQ Newbie
 
Registered: Dec 2006
Posts: 16

Rep: Reputation: 0
Question Thread is running slow for game!


Hi!

I'm currently porting the dedicated server for our game from win32 to linux.

After fighting my way until it compiles and run... i get extremly slow response from the linux server.

If i connect through LAN, i get like 700~900 ping.

The game is setuped like this :

- The main program is a console app waiting for input to interact with the game server
- The game logic itself is spawned in a thread

In win32, with default thread parameters, everything works perfectly.
But i suspect that i'm not setting up my pthread accordingly for linux.

Here is how i create the thread :
Code:
		pthread_attr_t threadAttr;	//attribute for parameting the linux thread
		pthread_attr_init(&threadAttr);
		pthread_attr_setinheritsched(&threadAttr, PTHREAD_EXPLICIT_SCHED);
		pthread_attr_setstacksize(&threadAttr,4000);  //reserving a 4 meg stack for the game
		pthread_attr_setschedpolicy(&threadAttr, SCHED_RR); //trying to
		sched_param schedparam;
 		schedparam.sched_priority = 99; //if i put 100 here the thread doesnt work
		pthread_attr_setschedparam(&threadAttr, &schedparam);
		
		if(pthread_create( &threadID, &threadAttr,(PTHREAD_START_ROUTINE)pFuncter, pParam))
		{
			perror("Thread Creation");
			return false;	
		}
i even tried to run this as root to make sure it wasnt something interfering with my user rights.

Thanks for any suggestions
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATI x850XT to slow to run any game popoe435 Linux - Games 1 06-26-2006 07:49 AM
Most Java runs fine, one game is slow Brain Drop Linux - Software 0 08-10-2004 11:10 AM
KDE VERY slow (and other thread advice isn't working) smith847be Linux - Software 7 06-08-2004 03:21 PM
glitchy/slow annimation in game zexter Linux - Software 2 11-01-2003 07:18 PM
Problem running a game ksgill Linux - Newbie 3 07-25-2003 11:50 PM


All times are GMT -5. The time now is 05:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration