Paul Rubin wrote:
> Any suggestions for the cleanest way to get rid of the thread?

As Jeff explains, it is rather unlikely that GC will collect
primegen objects, since the generating thread holds self as
a local variable.

You should make background_generator have explicit q and
event arguments, and you should signal the event in __del__.
However, this won't terminate the thread, since it still
hangs in .put. So it might be easiest to .read() in __del__
first.

Regards,
Martin
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to