|
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) |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |