discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURL loading system


From: Richard Frith-Macdonald
Subject: Re: NSURL loading system
Date: Mon, 17 Dec 2007 14:40:30 +0000
User-agent: GNUMail (Version 1.2.0)

On 2007-12-17 14:25:49 +0000 Philippe Roussel <address@hidden> wrote:

One quick question : synchronous operations in NSURLHandle (and other
classes if I remember correctly) use their asynchronous counterparts
and a busy wait loop. Isn't it possible to read/write synchronously
and 'select' on those operations instead ? Maybe it's too much work
for too little benefit ?

In the base library everything works asynchronously via NSRunLoop to avoid having things block the process (or require threads to avoid blocking problems). The NSRunLoop code uses the poll() system calls (or select() if poll is not available, or the mswindows equivalent call to wait for events), so it should never enter a busy wait loop. Rewriting to use synchronous I/O would require the use of threads, which would make the code rather less efficient (due to the need for locking) as well as harder to understand/debug because of thread interactions.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]