From: Zoran V. <zv...@ar...> - 2006-01-03 10:35:07
|
Am 03.01.2006 um 11:21 schrieb Andrew Piskorski: > Hm, does Tcl support asynchronous (non-blocking) IO for both network > sockets and local files? Tcl has 'fconfigure -blocking 0' of course, > but I don't know for sure whether that really does what you want for > this application. If Tcl DOES support it adequately, then all the > previous questions about how to do cross-platform asynchronous IO from > C vanish, which is a nice bonus. Tcl does this properly by implementing non-blocking IO (O_NONBLOCK or O_NDELAY) and adding their own event-loop processing salt. This works for both files and sockets. The truble is: you need a fully loaded Tcl for that. But we do have it anyways. If we restrict that across limited number of spooling threads, the overhead might not be large. Normally I'd start with spoolthread- per-cpu but the infrastructure must be made so that it allows several spooling threads to gain from multiple-cpu's in modern boxes. Zoran |