Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-20-2011, 08:13 AM   #1
LQ Newbie
Registered: May 2011
Posts: 11

Rep: Reputation: 0
posix timers issues and problem


i have problem regarding posix timers which was used in socket and thread programming. i like to know whether timers will handle only one thread at a time?? If it is yes, how can we use timers to handle multiple threads at the same time... i have socket programming code

/* server.c */
if(accept_of_client connection)
createthread(... func);

timer_t timerid;
value...... sec =2;//sample
timer_create (CLOCK_REALTIME, &sa, &timerid);

timer_settime (timerid, 0, &value, NULL);


recv(from client);
send(from server to client);

the above one is just sample code which shows you about my concept. it should accept all the client connection at any time and every 2 or 3 secs it should check whether any msg received from client or not.... the whole code working very fine. it accept connection from the client and able to receive and send msg until another client came. if another client came,cant able to receive msg from the first client........ i dont know why this was happening?? after severe execution, i think whether posix timers or setitimer handle one thread at a time or not?? if it is yes, how to set each timer for each thread ( it means for each client).. please clarify my doubts as soon as possible...

with regards,


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
Related to pthreads and timers in POSIX standard geek89 Programming 2 02-18-2010 04:57 AM
Posix timers affected by system clock changes. ljratner Linux - Software 0 11-06-2009 04:39 PM
usage of Posix timers titusabraham Programming 5 10-13-2009 07:13 PM
Posix timers not behaving correctly sean04 Programming 1 10-08-2007 12:34 AM
posix timers mailsteam Programming 7 05-19-2007 12:32 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:32 AM.

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