LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 06-02-2008, 06:03 AM   #1
Ashok_mittal
Member
 
Registered: Dec 2007
Posts: 73

Rep: Reputation: 15
Synchronization problem wait forever when multiple client socket programming


Dear all,

I am having a issue related to socket programming. whenever i have multiple client threads creation it goes into waiting stage. if you give usleep before pthread_create in the loop you will get it going no waiting , can anyone suggest me the possible reason

thanks
 
Old 06-02-2008, 06:23 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
post the minimal code that demonstrates your problem

also, do you realize that creating threads has a pretty big overhead? If you are looking at possibly hundreds of connections, it is better to deal with that using a minimal number of threads - certainly not 100, 1 would do fine but there's no reason to hit the program with a hammer until it uses only 1 thread. There is a very good reason Apache does not fork for every connection.

Last edited by pinniped; 06-02-2008 at 06:25 AM.
 
  


Reply



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
How to design multiple timeout in Socket Programming. lisa000 Programming 1 10-22-2007 11:12 PM
How to set multiple timeout in Socket Programming. lisa000 Linux - Networking 1 10-20-2007 05:08 PM
About multiple timeout in Socket Programming lisa000 Linux - General 1 10-20-2007 05:07 PM
About multiple timeout in Socket Programming lisa000 Linux - Software 1 10-20-2007 05:07 PM
a question about multiple connections in socket programming moloza Programming 7 05-22-2006 10:31 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:13 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
Open Source Consulting | Domain Registration