[Tutor] multithread question
János Juhász
janos.juhasz at VELUX.com
Mon Dec 3 20:43:48 CET 2007
Dear Tutors,
I have a multithread python service on a windows server,
that brekas down sometimes.
It is a service, that runs on a server and listen on the 9100
tcp port on three IP addresses, just as three jetdirect devices.
It listens as a virtual printer, captures the content of the
print jobs and makes local backups from them. It also creates
a bat file, that can be used to copy the captured files to the
real printers via nc.
I feel that the problem is somewhere on the write_files process.
The tree threads feeds the queues paralelly, and the manger.write_files()
is responsible to pick the first ones and write them into local files.
I have no got any idea, how may I controll to pick up them only once.
I am affraid that, this function is called more times from different
threads
in the same time, and it could stop that thread.
I have tried to place a try except into the threads itself, but
it made it absolutly unstable.
It was funny as it worked absolutly well in service debug mode
and stoped allways started in service mode, anyway.
I am also interested about that,
where should I place the try except blocks in the thread.
Yours sincerely,
______________________________
Janos Juhasz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071203/869f002a/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VirtualPrinterService.py
Type: application/octet-stream
Size: 7427 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20071203/869f002a/attachment.obj
More information about the Tutor
mailing list