hahaha wrote: Call [update] while other things are going on? I think the question is
> Thanks for your answer, how to implement an nested event loop ?
not so much "how do you create a nested event loop" as "what do you
think that creating a nested event loop will accomplish?
That is, what are you really trying to do?
The only way to get a good answer for what you need to do is to explain
what you're trying to do, not what you think you need to do. ;-)
It sounds like you're under the impression that "nested" event loops
will give you concurrence. They won't. They can, under limited
circumstances, give you the illusion of concurrence. Used too
liberally, they can also be almost as big of a headache as separate
threads (with the exception that they are determinate).
Think of event loops and [update] as "cooperative multitasking." Things
will run "at the same time," as long as you speckle your code with
enough calls to [update] (or uses of [after] or [fileevent]) to make it
"seem" like they are running at the same time. If you put in no
opportunities for one bit to sleep, it won't. Managing [update]s can be
fairly easy (e.g. a progress bar), but can, on occasion, be tricky,
because you're trying to "synchronize" events to happen when other
procedures enter their event loops.
If what you want is threads, use threads. If you want determinacy
without locks, at the cost of having to manage "multitasking" yourself,
use event loops.
Incidentally, I would assume, though someone please correct me if I am
wrong, that a single event loop would not take advantage of a MP system,
but threading should?