Re: Available memory and limit on thread creation

From: Roedy Green (look-on_at_mindprod.com.invalid)
Date: 07/02/04


Date: Fri, 02 Jul 2004 21:40:47 GMT

On Fri, 02 Jul 2004 21:13:34 GMT, Joseph Dionne <jdionne@hotmail.com>
wrote or quoted :

>
>One reason to block on system call is to eliminate the polling time that
>will be required to see if the external application has completed, and
>eliminates the need to maintain a socket to external application result
>list.

Think in terms of how an HTTP server works. Requests come in on
various sockets, but usually a request is a stateless GET. There is no
need to remember the state of what that socket was doing previously.
There does not need to be a thread waiting for that socket. As soon
as the i/o completes, the packet can be put into a queue and serviced
by a pool of threads.

There is no polling involved. The hardware gives you an interrupt
when the i/o completes. The queue of packets to be processed can be
empty, but even then that can be handled with a synchronization lock,
no polling required.

There are so many things you could potentially do with sockets. We
don't yet know what he is up to, so all we can do is toss out
possibilities.

-- 
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming. 
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Relevant Pages

  • Re: Performance Intel Pro 1000 MT (PWLA8490MT)
    ... > I used an old version of ttcp for testing. ... A small packet for me is ... > - when the tx queue fills up, the application should stop sending, at ... With polling, it would ...
    (freebsd-performance)
  • Problem with synchronous Socket
    ... I need to implement a socket server. ... private int Read ... Polling 100ms"); ... just enough to give the client enough time to send more data. ...
    (microsoft.public.dotnet.framework)
  • Re: aio_connect ?
    ... foprming operations of, say, _several_ different independent socket ... These are, I believe, just other ways of doing "polling" for completion, ... aio_*functions with their signaling capabilities provides the programmer ... I/O operations, and that this is fundamentally different, semantically, ...
    (freebsd-net)
  • Re: Available memory and limit on thread creation
    ... > need to remember the state of what that socket was doing previously. ... > There is no polling involved. ... > when the i/o completes. ... basic TCP/IP functionality, and definitely does not have HTTP logic. ...
    (comp.lang.java.programmer)
  • Re: Threading Issue with ArrayList
    ... messages during that loop. ... level and the application itself doesn't concern itself with when the socket ... read operations time out, so there is no loop in the application logic. ... I could setup a messaging system again that uses polling, ...
    (microsoft.public.dotnet.languages.csharp)