View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] XOTcl and Thread

From: Krzysztof Frukacz <frukacz.krzysztof_at_gmail.com>
Date: Thu, 10 Feb 2011 16:04:30 +0100

On 02/10/2011 03:26 PM, Victor Mayevski wrote:
> #Thread #1
> tsv::set array1 key2 [tread::id]
>
> #Thread #2
> set tid [tsv::get array1 key2]
> thread::send $tid [list $localVar doSomething]
>
> On Feb 10, 2011 5:27 AM, "Krzysztof Frukacz"
> <frukacz.krzysztof_at_gmail.com <mailto:frukacz.krzysztof_at_gmail.com>> wrote:

Hello Victor,

This looks like a nice solution. As far as I understand Thread #1 would
have to call thread::wait to enter event loop to be able to process what
was sent from Thread #2, right?
I would like Thread #1 to do its work and receive commands from Thread
#2. The problem is that when Thread #1 calls thread::wait it will wait
until another thread sends a script, right? In case there is nothing to
do (in the event loop) I would like Thread #1 to continue normal work.
How can I do that?

-- 
K