Re: thread package
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: thread package

From: David Gravereaux <davygrvy@pobox.com>
Date: Sun Oct 30 2005 - 19:33:22 CET

nicolas wrote:
> hi there,
> please, can someone answer these questions:
>
> i got the [thread::id] of my main thread like this tid0xa000b2a4
>
> if i create a thread2 with pthread, i create an interpreter in this
> thread2, i make a "package require Thread" in the thread2, i evaluate
> the following code to send result of calcul in the main /thread
> interpreter:
> thread::send -async tid0xa000b2a4 [list puts 1]
>
> where am i wrong, because i don't get any results.
>
> many thanks for any answer,
> best regards
>
> nicolas
>

You need to have the main thread service the Tcl event loop (actually
all threads if you want full -async to and fro support). For example,
wish does this this for you with Tk_MainLoop() as found in the source
code (see Tk_Main).
Received on Mon Nov 21 00:37:16 2005