Message23570
System is Python 2.3.3 on Solaris 9.
I'm using the classic Python thread model. Main thread puts stuff into
a Queue.Queue() and worker threads get stuff out of it and do their
thing.
On occaision, I get an exception in the main thread when it tries to
put something into the Queue.
File "/usr/local/bin/poller.py", line 47, in fragnap_it
work_queue.put((foo, bar, baz))
File "/usr/local/lib/python2.3/Queue.py", line 106, in put
self.fsema.release()
thread.error: release unlocked lock
This error still happens intermittently, and I haven't been able to
reduce it to a simple case. I can alter my applications to do
something useful for debugging this problem when it happens, if you
can figure out what "something useful" would be. Just let me know.
The queue is unbounded, and I'm using blocking get/put.
The main thread creates 20 worker threads, and 1 recorder thread.
Then it puts upto 1500 items in the Queue.Queue named
work_queue. The 20 worker threads take stuff out work_queue,
process some using pure python code, or others by using
subprocess.py. Results from the workers are put into another
Queue.Queue named results_queue. The Recorder thread gets from
the results_queue and writes stuff to a MySQL db. I've never seen the
error happen when putting into the results_queue, only from the main
thread putting into the work_queue.
Thread defines in my python config.h are:
#define HAVE_PTHREAD_H 1
#define HAVE_PTHREAD_SIGMASK 1
#define HAVE_THREAD_H 1
#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1
#define SIZEOF_PTHREAD_T 4
#define WITH_THREAD 1
And all the thread related python tests (test_thread, test_threading,
and test_queue) pass. |
|
Date |
User |
Action |
Args |
2007-08-23 14:28:15 | admin | link | issue1080660 messages |
2007-08-23 14:28:15 | admin | create | |
|