0

Hi,
It is possible to get values from thread , while thread is executing , but not yet complete?
if it is possible then how can I realise it in python?

with hope to solution

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by BearofNH
0

In the past I have used global variables to pass messages to/from threads. In order to avoid disaster I only allow one thread to write to any given variable.

There are operating-system-specific message passing primitives you can also use, but then they tend to be operating system specific, or relatively heavyweight like networking.

0

In this case global variables are not suitable.
Maybe do you know another solution?
the basic problem is : I have a webservice and I need to get results from webservice , when it is not yet finished..

0

Package the results you need in a class designed for that purpose.
Each thread you start, pass a unique class instance.
Have the thread routine modify fields in the class instance as appropriate.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.