On Tue, Jan 03, 2006 at 09:49:02AM +0100, Zoran Vasiljevic wrote:

> The spooling threads operate in event-loop mode. There has to be
> some kind of dispacher which evenly distributes the processing among
> spooling threads.

Or just start out with one spool thread, support for multiple spool
threads can be added later, as it's not really necessary, just a
possible performance tweak for large SMP machines.  Then again, all
the thread pool infrastructure is probably already there, so using it
from the get go might be simple.

> Once in the spooling thread, the connection is processed entirely
> asynchronously as in Tcl event-loop. In fact, this whole thing can
> be implemented in Tcl with the building blocks we already have:
> channel-transfer between threads, thread management (create,
> teardown). Event the dispatcher can be done in Tcl alone.

I particularly like the all non-blocking, all event driven, all Tcl
design of your spool threads.  You can always add bits of C code later
if that turns out to be more efficient, but being able to do the whole
thing in Tcl is very nice.

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.

> I hope I did not write a tons of nonsense and thank you for being
> patient and reading up to here :-)

On the contrary, that was by far the clearest design explanation I've
yet seen in this discussion.

-- 
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/

Reply via email to