[ZODB-Dev] Webkit Threading and ZODB 3.3a2: problems on Windows

Matt Feifarek matt at dalchemy.com
Thu Feb 19 14:18:24 EST 2004


On Wed, Feb 18, 2004 at 10:22:13PM -0500, Tim Peters wrote:
| [Matt Feifarek, w/ some ugly thread symptoms seen only on Windows]
| 
| Matt, what does this print for you if you run it on your Linux box?
| 
| """
| import thread, time
| 
| def worker():
|     print thread.get_ident()
| 
| for i in range(10):
|     thread.start_new_thread(worker, ())
|     time.sleep(1)
| """

On linux:
1026
2050
3074
4098
5122
6146
7170
8194
9218
10242

On Winders: (don't know why I'm getting doubles)
(Note, this windows box is python 2.2.1 not 2.3.2... but I'm away from
that box today)

1716
1716
1780
1780
684
684
1120
1120
964
964
848
848
1364
1364
576
576
376
376
764
764

| If you let a thread die with changes in progress (neither commit nor abort on its then-current transaction), it looks all but certain to me that ZODB's tid->transaction dict will get confused by the next thread Windows creates (which is all but certain to have the same tid as the thread that just died).

So is it "best practice" to do abort() even if no changes are made? Is
there even a transaction if no changes are made?

Thanks.

I'll followup on the other windows box later today.



More information about the ZODB-Dev mailing list