[Xotcl] XOTcl and Thread

Krzysztof Frukacz frukacz.krzysztof at gmail.com
Thu Feb 10 16:04:30 CET 2011


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


More information about the Xotcl mailing list