Version française
Home     About     Download     Resources     Contact us    
Browse thread
Smart ways to implement worker threads
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Romain Beauxis <toots@r...>
Subject: Re: [Caml-list] Smart ways to implement worker threads
Le jeudi 15 juillet 2010 12:46:53, Goswin von Brederlow a écrit :
> I don't see where that helps at all. I don't want to offload the IO into
> threads and schedule them and Duppy seems to only handle IO tasks.

I don't understand what you mean by IO tasks. Tasks in duppy are scheduled 
according to some events which, since it is select-based, are either an event 
on a socket or a timeout.

Once scheduled, the action that the task does is anything you programmed. Once 
finished, the tasks can return an array of new tasks which are then put in the 
queue.

In your case, you probably only need the timeout event, which would mean that 
as soon as you have a new tasks to perform, you submit it to the scheduler 
with timeout 0 and it will be processed by one of the threads as soon as 
possible..

> Except if I pick Solution 1 and then it still doesn't help anything
> since I can already run select in every thread. The IO should not be
> scheduled by priorities and isn't the bottleneck anyway. Seems this
> would just add overhead.

The idea of duppy was to have only one select running among the multiple queue 
threads.


Romain