Re: [naviserver-devel] task backport?

2006-01-04 Thread Stephen Deasey
On 1/4/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote: > I believe poll can be used on any file descriptor, not only sockets. > It doesn't work if the file descriptor is backed by a file on disk. If it did, we wouldn't have to talk about aio_read():-)

Re: [naviserver-devel] task backport?

2006-01-04 Thread Vlad Seryakov
As far as i remember JimD rewrote ns_http using new tasks API, but other than that i do not know where/how tasks API is used. Tasks API is good, i agree it is more generic and Tcl interface can be built around it so instead of using Tcl event loop it will be possible to use tasks. with Tcl ma

Re: [naviserver-devel] task backport?

2006-01-04 Thread Zoran Vasiljevic
Am 04.01.2006 um 16:10 schrieb Vlad Seryakov: I believe poll can be used on any file descriptor, not only sockets. It is generic socket/fds callback infrastructure, it is very similar to socket callbacks we already have in sockcallback.c. Does not make sense to have both, they duplicating e

Re: [naviserver-devel] Upload Progress

2006-01-04 Thread Vlad Seryakov
I find it confusing that the actual spooling code is not in the SpoolThread, but still in SockRead(). Take a look at nsd/task.c. I think you should be able to implement this as a Ns_Task callback, which gives you the extra thread and all the poll handling etc. for free. Move the spooling code

Re: [naviserver-devel] task backport?

2006-01-04 Thread Vlad Seryakov
I believe poll can be used on any file descriptor, not only sockets. It is generic socket/fds callback infrastructure, it is very similar to socket callbacks we already have in sockcallback.c. Does not make sense to have both, they duplicating each other Stephen Deasey wrote: On 1/4/06, Zora

Re: [naviserver-devel] task backport?

2006-01-04 Thread Stephen Deasey
On 1/4/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: > > Am 04.01.2006 um 11:35 schrieb Stephen Deasey: > > > The queue thread monitors all sockets for events > > (readable/writeable) and then runs the callbacks. > > > > > > Isn't this what the driver thread is doing? > Is this a potential repla

Re: [naviserver-devel] task backport?

2006-01-04 Thread Stephen Deasey
On 1/4/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: > > Am 04.01.2006 um 11:35 schrieb Stephen Deasey: > > > It's an API for async network IO. You create a queue which is managed > > by a single thread. You add tasks to the queue. A task is a callback > > and a socket event. The queue thread

Re: [naviserver-devel] task backport?

2006-01-04 Thread Zoran Vasiljevic
Am 04.01.2006 um 11:35 schrieb Stephen Deasey: The queue thread monitors all sockets for events (readable/writeable) and then runs the callbacks. Isn't this what the driver thread is doing? Is this a potential replacement/abstraction of the driver thread?

Re: [naviserver-devel] task backport?

2006-01-04 Thread Zoran Vasiljevic
Am 04.01.2006 um 11:35 schrieb Stephen Deasey: It's an API for async network IO. You create a queue which is managed by a single thread. You add tasks to the queue. A task is a callback and a socket event. The queue thread monitors all sockets for events (readable/writeable) and then runs th

Re: [naviserver-devel] task backport?

2006-01-04 Thread Stephen Deasey
On 1/4/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: > Interesting... > What is a "task" (in a nutshell)? > It's an API for async network IO. You create a queue which is managed by a single thread. You add tasks to the queue. A task is a callback and a socket event. The queue thread monitors

Re: [naviserver-devel] Upload Progress

2006-01-04 Thread Stephen Deasey
On 1/3/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote: > I am attaching the whole driver.c file because patch would not be very > readable. > > See if this a good solution or not, it works and uses separate thread > for all reading and spooling, also all upload stats are done in the > spoller thread,

[naviserver-devel] task backport?

2006-01-04 Thread Zoran Vasiljevic
Interesting... What is a "task" (in a nutshell)? Cheers Zoran