Networking Forums

Networking Forums > Computer Networking > Linux Networking > scheduling threads ?

Reply
Thread Tools Display Modes

scheduling threads ?

 
 
vivekian
Guest
Posts: n/a

 
      04-18-2006, 01:48 AM
Hi ,

Writing a peer to peer application using pthreads , where two threads
are started one after the other. Thread threadBroadcaster broadcasts
UDP messages using sendto . Thread threadReceiver receives UDP messages
using recvfrom . So ..

int main ( )
{

..........
pthread_create ( &tidA , NULL , & threadBroadcaster , & args ) ;

pthread_create ( &tidB , NULL , & threadReceiver , & args ) ;

}

While executing , the Receiver thread sets up a socket and binds
successfully. But on waiting for a message , the execution switches to
the Broadcaster thread and somehow execution does not return to the
Receiver thread , while the Broadcaster continues execution. Is there
something i am missing out on ?

Thanks in advance,
vivekian

 
Reply With Quote
 
 
 
 
vivekian
Guest
Posts: n/a

 
      04-18-2006, 02:38 AM
never mind .. there was something else that was been done wrong.

vivekian wrote:
> Hi ,
>
> Writing a peer to peer application using pthreads , where two threads
> are started one after the other. Thread threadBroadcaster broadcasts
> UDP messages using sendto . Thread threadReceiver receives UDP messages
> using recvfrom . So ..
>
> int main ( )
> {
>
> ..........
> pthread_create ( &tidA , NULL , & threadBroadcaster , & args ) ;
>
> pthread_create ( &tidB , NULL , & threadReceiver , & args ) ;
>
> }
>
> While executing , the Receiver thread sets up a socket and binds
> successfully. But on waiting for a message , the execution switches to
> the Broadcaster thread and somehow execution does not return to the
> Receiver thread , while the Broadcaster continues execution. Is there
> something i am missing out on ?
>
> Thanks in advance,
> vivekian


 
Reply With Quote
 
gnanam
Guest
Posts: n/a

 
      04-18-2006, 04:49 PM
Send your total code to me.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about sockets and threads Lorenzo Linux Networking 1 03-01-2008 08:04 AM
All my threads are disappearing. Derrick Fawsitt Broadband 4 03-29-2007 12:52 AM
OT: Saving Google threads as TXT? Terry Pinnell Broadband 2 01-27-2005 05:10 PM
Scheduling John Holt Windows Networking 2 09-15-2004 06:19 PM
multiple threads, same socket...safe? JW Linux Networking 0 08-11-2003 12:30 AM



1 2 3 4 5 6 7 8 9 10 11