Asynchronous Socket-IO and Multithreading
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Asynchronous Socket-IO and Multithreading




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Asynchronous Socket-IO and Multithreading  
Reinhard Eilmsteiner


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-04 09:34 PM

Hello Everybody!

I just set up a couple of objects for network communication (as a
library). I use socket-, signal handler-, thread-objects etc. to realize
a TCP-Server.
I put the listening socket into the non-blocking asynchronous state
using flags O_NONBLOCK and O_ASYNC and set the owning thread to the
caller using F_SETOWN. The thread that calls all the necessary functions
on the listening socket is the main thread of the server.
Everything works so far: The consequent accept calls work asynchronously
from all the listener threads created (using libpthread) from the main
thread.
After the accept I start yet another thread for each incoming
connection, passing the accepted socket on to it.
The new thread does exactly the same with its socket as the main thread
did with the listening socket, but: somehow no SIGIOs are sent to any of
the threads (even without filtering).

What's wrong?

If I don't use Async-IO everything works fine.

Any ideas?

Regards and thanx,
Reinhard.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:37 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register