caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Goswin von Brederlow <goswin-v-b@web.de>
To: Romain Beauxis <toots@rastageeks.org>
Cc: Goswin von Brederlow <goswin-v-b@web.de>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Smart ways to implement worker threads
Date: Sat, 17 Jul 2010 16:08:14 +0200	[thread overview]
Message-ID: <878w5aryk1.fsf@frosties.localdomain> (raw)
In-Reply-To: <201007170951.07709.toots@rastageeks.org> (Romain Beauxis's message of "Sat, 17 Jul 2010 09:51:07 -0400")

Romain Beauxis <toots@rastageeks.org> writes:

> Le samedi 17 juillet 2010 05:07:48, Goswin von Brederlow a écrit :
>> No, it couldn't. The main thread must be blocked waiting for something.
>> That something would either be waiting for select to return or the main
>> thread runs a queue and a seperate select thread and worker threads
>> throw tasks at it. I'm not having a main thread that checks every 0.001s
>> if a task happens to be done.
>
> Then use a Condition.wait on the main thread and Condition.signal in each 
> tasks. This is meant for that.
>
> I mean, there's not gonna be a ready-to-use solution for you. At some point 
> you'll have to be a little bit creative.
>
>
> Romain

Sure. I was just explaining why I made the main thread run a queue and
wait for tasks as well, not just the worker threads.

MfG
        Goswin


  reply	other threads:[~2010-07-17 14:08 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-14 16:09 Goswin von Brederlow
2010-07-15 15:58 ` [Caml-list] " Rich Neswold
2010-07-15 16:19   ` David McClain
2010-07-15 17:16   ` Ashish Agarwal
2010-07-15 18:24   ` Goswin von Brederlow
2010-07-15 18:37     ` David McClain
2010-07-15 18:40     ` David McClain
2010-07-15 19:56     ` Rich Neswold
2010-07-16  4:02       ` Goswin von Brederlow
2010-07-16  4:23         ` Rich Neswold
2010-07-16 13:02           ` Goswin von Brederlow
2010-07-16 14:40             ` Dawid Toton
2010-07-16 16:18             ` [Caml-list] " Rich Neswold
2010-07-17 17:53               ` Eray Ozkural
2010-07-20  4:54             ` Satoshi Ogasawara
2010-07-17 18:34         ` Eray Ozkural
2010-07-17 19:35           ` Goswin von Brederlow
2010-07-17 22:00             ` Eray Ozkural
2010-07-15 16:32 ` Romain Beauxis
2010-07-15 17:46   ` Goswin von Brederlow
2010-07-15 18:44     ` Romain Beauxis
2010-07-16  3:52       ` Goswin von Brederlow
2010-07-16  4:19         ` Romain Beauxis
2010-07-16 13:05           ` Goswin von Brederlow
2010-07-16 13:20             ` Romain Beauxis
2010-07-17  9:07               ` Goswin von Brederlow
2010-07-17 13:51                 ` Romain Beauxis
2010-07-17 14:08                   ` Goswin von Brederlow [this message]
2010-07-17  9:52 ` Goswin von Brederlow
2010-07-17 14:20   ` Romain Beauxis
2010-07-17 15:52     ` Goswin von Brederlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878w5aryk1.fsf@frosties.localdomain \
    --to=goswin-v-b@web.de \
    --cc=caml-list@yquem.inria.fr \
    --cc=toots@rastageeks.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).