logo       

An unsafe threading practice?: msg#00043

lang.jython.user

Subject: An unsafe threading practice?

I have a multi-threaded Java program that will use a class written in Jython. Is it better for each thread in my Java program to create its own instance of this Jython class, or should a singleton Jython class instance be shared among the Java threads? The Jython class only uses local variables, I would want to use it unsynchronized.

It occurs to me while reading though the generated jythonc code that it heavily uses static objects which are later initialized. How then can it be safe for multiple Java threads to each have their own instance of the same Jython class?

Thanks in advance for any help!
Rob



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise