In general, it is not a good idea to assume any class/method is thread safe, even in Java. Unfortunately, Java tends to give programmer a false sense of security when it comes to threading issues. In Java, it is too easy to create threads, IO packages must use threads, and synchronization keywords make people think that threads are easy to use. As people have pointed out, using thread requires careful design and implementation. Tossing around synchronized in Java code is an invitation to trouble. Tcl and Tcl/Blend uses message passing as the way to communicate between threads. This is a well design, efficient and very standard way for thread communication and data sharing. In Tcl/Blend, only the Notifier class (and may be some other static methods) is designed to be thread safe. But I do agree that there needs to be better documentation or code to help with the correct usage of the model. What if we are to add a few helper methods such as: public static tcl.lang.Interp Interp.createInterp(); which will create a thread, create an Interp to use the dedicated thread, start the event listener, and return the Interp. Or have something like this for people using TclBlend with non-threaded Tcl: public static tcl.lang.Interp Interp.getTheGlobalInterp(); which checks to see if the global interpreter is created already. If it is, returns the global Interp object. If not, create the interpreter, assigns it a thread, starts the event listener, and returns the Interp. -- Jiang Wu [EMAIL PROTECTED] > -----Original Message----- > From: Mike Schwartz [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 25, 2000 3:58 PM > To: Mo DeJong > Cc: [EMAIL PROTECTED] > Subject: [Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking > tclBlend calls from within Java threads > > > Well, this is a matter of personal taste I suppose, but in my view > making non-threadsafe code in this day-and-age, especially > code that is > intended to interoperate with a language (Java) that is designed to > make it easy to build threaded apps, is problematic. Asking > programmers to build event queues to avoid the problem seems > like not a ---------------------------------------------------------------- The TclJava mailing list is sponsored by Scriptics Corporation. To subscribe: send mail to [EMAIL PROTECTED] with the word SUBSCRIBE as the subject. To unsubscribe: send mail to [EMAIL PROTECTED] with the word UNSUBSCRIBE as the subject. To send to the list, send email to '[EMAIL PROTECTED]'. An archive is available at http://www.mail-archive.com/tcljava@scriptics.com