Re: [tcljava-dev] Problem related to Tcl..
Brought to you by:
mdejong
From: Mo D. <mo...@mo...> - 2008-11-20 21:20:13
|
Swapnil Manthanwar wrote: > > Hi, > > I am trying to call java thread class from tcl code. Is > it possible to implement threading in tcl? Can I get any code snippets > how it can be achieved? > > Hi Swapnil Threading is part of the OS, it is not part of Java or Tcl. What I think you might be asking is how one can create a Tcl interpreter in a thread. This is supported by the existing APIs, the way you set things up depends on your situation. A brief overview of using an interp's event queue is given here: http://tcljava.sourceforge.net/docs/website/getstart.html The main thing to keep in mind is that your interp will typically run in one thread and just process events added to the thread safe event queue. Other threads will then add events to this queue and they will be processed one at a time. For a more detailed overview, see the following docs (included in 1.4.1 download) http://tcljava.cvs.sourceforge.net/viewvc/*checkout*/tcljava/tcljava/docs/Topics/EventLoop.html?revision=1.2 cheers Mo DeJong |