Re: issues with Trellis event loops and threads

"Sergey Schetinin" <[email protected]>
Newsgroups gmane.comp.python.peak
Message-ID <[email protected]>
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 <[email protected]> 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-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.