Topic
  • 2 replies
  • Latest Post - ‏2012-09-03T13:38:49Z by Prithiviraj
Prithiviraj
Prithiviraj
3 Posts

Pinned topic High performance scokets : Accept() Vs QSOStartAccept()

‏2012-08-29T15:27:45Z |
Experts:

Can somebody please help understand the working and usage difference between accept() vs qsostartaccept() in ? To me it appears like i can live with accept and qsostartrecv, IOCP and bunch of worker threads in a never ending loop to support simultaneous clients. What am I missing if am not using qsostartaccept ?
WHILE(ServerSwitch == *On)
{
client_sd = accept(listen_sd.....)
qsostartrecv(client_Sd......)
}
Updated on 2012-09-03T13:38:49Z at 2012-09-03T13:38:49Z by Prithiviraj
  • Kent_Bruinsma
    Kent_Bruinsma
    1 Post

    Re: High performance scokets : Accept() Vs QSOStartAccept()

    ‏2012-08-31T19:02:45Z  
    Using QsoStartAccept() eliminates dedicated threads that spend 99% of their time blocked on an accept() call. The dedicated threads have a "cost" in system/process resources. Dormant threads incur a cost as they wake up and have their resources paged into memory and cache lines. Having "hot" threads process the intermittent new connections along with the more consistent data processing is more efficient. Conceptually it is easy to see the benefits but in practice it is difficult to measure or quantify.

    If high performance is important, then working QsoStartAccept() into the design is helpful to the overall picture. However, QsoStartAccept() will not make or break the performance of the application on its own.
  • Prithiviraj
    Prithiviraj
    3 Posts

    Re: High performance scokets : Accept() Vs QSOStartAccept()

    ‏2012-09-03T13:38:49Z  
    Using QsoStartAccept() eliminates dedicated threads that spend 99% of their time blocked on an accept() call. The dedicated threads have a "cost" in system/process resources. Dormant threads incur a cost as they wake up and have their resources paged into memory and cache lines. Having "hot" threads process the intermittent new connections along with the more consistent data processing is more efficient. Conceptually it is easy to see the benefits but in practice it is difficult to measure or quantify.

    If high performance is important, then working QsoStartAccept() into the design is helpful to the overall picture. However, QsoStartAccept() will not make or break the performance of the application on its own.
    Thanks for the reply Kent,

    While I understand that QsoStartaccept() isn't blocking I/O plus threads are dormant, i dont get how qsostartRecv() should work after the qsostartaccept() call... i took the example from IBm site and changed it to support complete Async I/O, where qsostartrecv gets control and fails with return code -1 / 3450 when no active clients. But ideally server should go back to listening mode.

    Do you have a C example to share ?

    Regards
    Prithiviraj