[PEAK] issues with Trellis event loops and threads
Sergey Schetinin
maluke at gmail.com
Mon Jul 21 10:46:28 EDT 2008
I also think there should be a way to use the actual current state in
the other thread, but context.States just doesn't work that way. I see
no reason why it has to be that way. The app can set up it's current
state and then start an operation in a new thread, it's only natural
to make sure it works in the same / child context, but with all the
"states[get_indent()]" that wouldn't work at all. Am I missing
something or is that a design defect?
On Mon, Jul 21, 2008 at 17:35, Sergey Schetinin <maluke at gmail.com> wrote:
> Well, I get that, but I think that essentially, the only thing I need
> is to have the same Time instance be the current in more than one
> thread. As long as that is true the newly created dependency in the
> non-eventloop thread will schedule a recalc in the main one. I realize
> that it depends on EventLoop implementation in use and that it might
> break with a future release, but I certainly think that in my case
> it's a lesser evil than isolating the threads cells completely. And
> the way Service and State are implemented I'm struggling to find a way
> to do that. So if you could suggest a way to accomplish that,
> hopefully that's all I need. Also, if you have any ideas on how
> Trellis could handle multiple threads in the future (if there are any
> plans for that), that would be great to know.
>
> Thanks.
>
> On Mon, Jul 21, 2008 at 17:21, Phillip J. Eby <pje at telecommunity.com> wrote:
>> The Trellis does not support inter-thread communication at this time; each
>> thread's cells must be 100% isolated from other threads, and each thread
>> needs its own, isolated EventLoop. You can, of course, make a special
>> eventloop class that communicates with a main eventloop, if you need to.
>> But you'd need to do it using a Queue.Queue or some other safe inter-thread
>> communication mechanism.
>>
>>
>
>
>
> --
> Best Regards,
> Sergey Schetinin
>
> http://s3bk.com/ -- S3 Backup
> http://word-to-html.com/ -- Word to HTML Converter
>
--
Best Regards,
Sergey Schetinin
http://s3bk.com/ -- S3 Backup
http://word-to-html.com/ -- Word to HTML Converter
More information about the PEAK
mailing list