Proposal: System.Timeout module for base (Trac #980)

Bayley, Alistair Alistair_Bayley at invescoperpetual.co.uk
Thu Mar 1 03:43:59 EST 2007


I have a comment on one of the comments (or perhaps a question): 

-- Foreign function calls, for example, cannot be timed out with this
-- combinator simply because an arbitrary C function cannot receive
-- asynchronous exceptions. When @timeout@ is used to wrap an FFI call
that
-- blocks, no timeout event can be delivered until the FFI call returns,
which
-- pretty much negates the purpose of the combinator. In practice,
however,
-- this limitation is less severe than it may sound. Standard I\/O
functions
-- like 'System.IO.hGetBuf', 'System.IO.hPutBuf',
'Network.Socket.accept', or
-- 'System.IO.hWaitForInput' appear to be blocking, but they really
don't
-- because the runtime system uses scheduling mechanisms like
@select(2)@ to
-- perform asynchronous I\/O, so it is possible to interrupt standard
socket
-- I\/O or file I\/O using this combinator.

In my experience, when run with -threaded, Network.Socket.accept does
block, and async exceptions are not delivered (I'm using GHC-6.6 on Win
XP). Is this what I should expect, or is it more likely that I've
configured something (like my socket) incorrectly so that it blocks?

Alistair
*****************************************************************
Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
*****************************************************************


More information about the Libraries mailing list