scheduling threads ? - Linux
This is a discussion on scheduling threads ? - Linux ; 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 ...
-
scheduling threads ?
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
-
Re: scheduling threads ?
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
-
Re: scheduling threads ?
Send your total code to me.