returning a value from a thread

Ken Godee ken at perfect-image.com
Wed Jul 14 17:54:10 EDT 2004


>>Using thread here.
>>But I really have nothing against using queue, I've used queues before
>>but more for a kind of stream of data and was thinking I was missing
>>something because I only want to pass back a single value, so Queue(1)
>>would probally be alright.
> 
> 
> Have you considered simply making the function in module2 return the
> thread object that it has started as its response?  That thread object
> could easily support an interface to interrogate its status or result
> (when available).

I'm weaving quite a snake here already, there's even more modules
in the flow then what I've mentioned, including GUI stuff.
Didn't want to rewrite or make it tougher than need be just
to get a single value back to module1.

The returned value is not very time sensitive, just needed later
in program execution. So far this is the only thread I've needed
to retain UI response.

Although I'm learning alot more about threading and would set things
up quite differently if I was starting this program from scratch.




More information about the Python-list mailing list