Re: sockaddr_in() timeout or asynchone call ?

"JG" == Jim Gibson <jgibson@xxxxxxxxxxxxxxxxx> writes:

JG> The choice to prevent a program blocking on I/O usually involves
JG> either non-blocking I/O (polling) or asynchronous I/O (e.g, the
JG> select statement or forking/threading). Both have their
JG> complications.

you are conflating several things there. the blocking nature of the
socket has nothing to do with whether you use select on it. and select
has nothing to do with forking/threads. and async i/o can means using
the OS's async i/o ops or an event loops that supports it or even using
threads. so you can pretty much mix and match all of those things and
you don't have an either/or situation.

but i agree with your main assessment, sockaddr_in just does some simple
IP address munging and should never block. the OP is confused or
misunderstood something.


Uri Guttman ------ uri@xxxxxxxxxxxxxxx --------
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ----------------------------

Relevant Pages

  • Interesting windows file I/O performance. Can someone explain?
    ... Today we wrote a small application that simulated our disk I/O usage. ... i/o is slightly faster and in some they are the same. ... When writing to a single file, synchronous I/O is almost 3 times ... And while async i/o is going on, ...
  • RE: async I/O seems to be blocking on 2.6.15
    ... Drop the size for each I/O to something like 4KB will significantly reduce ... I haven't done the measurement whether the time to submit I/O ... How should I do my async I/O if I just want to read or write ... files on seperate disks and hopefully on seperate controllers, ...
  • Re: Why is deleting (or reading) files not counted as IO-Wait in top?
    ... Simply because the only I/O that XFS does during a delete is ... CPU is.... ... 'Amount of time the CPU has been waiting for I/O to complete.' ... Async I/O means that typically your CPU does not get held up ...