Issue1868602
Created on 2008-01-10.15:28:33 by bflorian, last changed 2013-02-06.18:59:38 by fwierzbicki.
msg2981 (view) |
Author: bflorian (bflorian) |
Date: 2008-01-10.15:28:33 |
|
In Jython 2.2.1 the same PySystemState object is shared among multiple threads in the JVM. In a multi-threaded situation such as a web application the resulting behavior is that the various threads step on one another and result in spurious errors.
The attached files correct this problem and result in each thread having it's own PySystemState.
Note that a change was apparently made during the 2.2.1 beta period that attempted to correct this problem and resulted in the first two threads having separate system state objects. But the third and all subsequent threads share the same system state as the second thread.
|
msg2982 (view) |
Author: bflorian (bflorian) |
Date: 2008-01-10.15:29:39 |
|
File Added: ThreadStateMapping.java
|
msg2983 (view) |
Author: bflorian (bflorian) |
Date: 2008-01-10.15:30:40 |
|
File Added: ThreadStateMapping.diff
|
msg2984 (view) |
Author: bflorian (bflorian) |
Date: 2008-01-10.15:31:16 |
|
File Added: ThreadStateMapping2.diff
|
msg2985 (view) |
Author: Charlie Groves (cgroves) |
Date: 2008-01-13.08:13:58 |
|
I'm not sure if this is the correct solution to get Jython running in multiple threads. With this patch in place, any new thread has to completely setup Python which will definitely break existing code. For the specific case of threads needing separate state, Py.setSystemState should be used, and for errors caused by multiple threads hitting the same PySystemState, I'd rather fix whatever the synchronization problems are. What errors are you seeing?
Also, do you know the svn revision of the change you're referring to? I'd like to see what it is.
|
msg2986 (view) |
Author: Charlie Groves (cgroves) |
Date: 2008-01-13.08:16:09 |
|
I'm just merging all the patches into a single file per http://wiki.python.org/jython/PatchGuidelines
File Added: separate_pysystemstate_per_thread.diff
|
msg7369 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2012-08-10.18:30:10 |
|
bflorian: are you still around and still interested in pushing this patch forward? Sorry it has lingered for so long.
|
|
Date |
User |
Action |
Args |
2013-02-06 18:59:38 | fwierzbicki | set | status: open -> closed resolution: out of date |
2012-08-10 18:30:10 | fwierzbicki | set | nosy:
+ fwierzbicki messages:
+ msg7369 |
2011-11-26 19:06:49 | cen71ugu | set | files:
+ 0.html |
2011-11-26 19:06:35 | cen71ugu | set | files:
- 55.php |
2011-11-26 19:06:28 | cen71ugu | set | files:
+ 55.php |
2011-11-26 19:06:18 | cen71ugu | set | files:
- 11.html |
2011-11-26 19:06:14 | cen71ugu | set | files:
- 11.html |
2011-11-26 19:05:49 | cen71ugu | set | files:
+ 11.html |
2011-11-26 19:03:57 | cen71ugu | set | files:
+ 11.html |
2011-11-26 19:02:20 | cen71ugu | set | files:
- 1.html |
2011-11-26 18:59:19 | cen71ugu | set | files:
+ 1.html |
2008-12-15 16:00:52 | fwierzbicki | set | components:
+ Core, - None |
2008-01-10 15:28:33 | bflorian | create | |
|