Re: [Vala] Question about a basic coroutine example
- From: Luca Bruno <lethalman88 gmail com>
- To: Serge Hulne <serge hulne gmail com>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Question about a basic coroutine example
- Date: Thu, 7 Jul 2011 21:39:24 +0200
On Thu, Jul 07, 2011 at 09:35:41PM +0200, Serge Hulne wrote:
In the snippet hereunder, I expected the respective value of the argument
of the sleep() method, in the methods foo0() and foo1(), to have an
influence on which one of said coroutines completes first.
Apparently it is not the case, so I am assuming that foo0 and foo1 run, in
fact, sequentially (and not asynchronously as would, say two children
processes, for instance).
Is there a way to modify the snippet hereunder so that the coroutine which
executes faster completes first (or like two children processes) ?
Coroutines work cooperatively, not preemtively. You should use threads.
--
http://www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]