Thank you very much to all. I found out solution. I created separate thread
from GUI and everything is working correct.
Best Regards,
/Gelios
--
http://mail.python.org/mailman/listinfo/python-list
Nodir Gulyamov wrote:
> [...]I should show you real code
[...]
> Please find below real code. Sorry for amount of sources.
Yeah, it's too much for me. Can you construct a minimal
example that doesn't do what you think it should?
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-li
Dennis,
I am really appreciated you comments. Thanks you very much.
And let me a little bit explain idea of program. I should did it earlier.
Instead of empty loops i already tried to use time.sleep() firstly, but
effect was same, all other threads do not working too and as experiment i
tried
Hello Dennis and Bryan!
You were absolutely right. I should show you real code instead of brain
fucking. I am very sorry.
Please find below real code. Sorry for amount of sources.
Main aspect of program is all process should be in one determined sequence
containing 3 stages. They are defined
Nodir Gulyamov wrote:
> Hi again, comments below:
>
>
>>>doSomeJob(self):
>>># BLOCKING HERE ###
>>>if not self.myEvent.isSet():
>>>self.myEvent.wait()
>>
>>The initial 'if' is superflous.
>
> Excuse me, please explain.
The code:
if some_event.i
Hi again, comments below:
> > doSomeJob(self):
> > # BLOCKING HERE ###
> > if not self.myEvent.isSet():
> > self.myEvent.wait()
>
> The initial 'if' is superflous.
Excuse me, please explain.
> > self.myEvent.clear()
> > # ... continue...
> >
>
Hi,
Thanks your reply again. Please find my comments below.
> Your code did not, and could not, use the value of counter for
> anything but busy-waiting. You had:
>
> while counter != 1:
> pass
> # ... continue...
>
> If you replace this with the semaphore, you can
Nodir Gulyamov wrote:
> Tried to rewrite using Event() just as experiment, but unfortunately
> MainThread will blocking all others.
> Code below:
>
> import threading
>
> class class1:
> def __init__(self):
> self.myEvent = threading.Event()
> result = doSomeJob()
>
Nodir Gulyamov wrote:
> Hi Bryan,
> Thanks for your reply.
> I tried to test your solution, but it doesn't work, hence
> threading.Semaphore object hasn't method to get value of semaphore.
> I looked to source code of semaphore.py and find out that value is
private
> variable.
Your code
Tried to rewrite using Event() just as experiment, but unfortunately
MainThread will blocking all others.
Code below:
import threading
class class1:
def __init__(self):
self.myEvent = threading.Event()
result = doSomeJob()
def increaseCounter(self):
self.myEvent.
I had future investigation and as I understand in POSIX compliant threads,
getting value of semaphore should be exist.
As the matter of fact Python threads is not fully POSIX compliant. Pitty!
Contining looking for another solution.
"Nodir Gulyamov" <[EMAIL PROTECTED]> wrote in message
news:[EMA
Hi Bryan,
Thanks for your reply.
I tried to test your solution, but it doesn't work, hence
threading.Semaphore object hasn't method to get value of semaphore.
I looked to source code of semaphore.py and find out that value is private
variable.
Best regards,
/Gelios
"Bryan Olson" <[EMAIL PRO
I wrote:
> Make self.counter a semaphore. Untested code:
A little clean-up. Still untested:
import threading
class class1:
def __init__(self):
self.counter = threading.semaphore(0)
result = self.doSomeJob()
def increaseCounter(self):
self.counter.release()
Nodir Gulyamov wrote:
> Hello All!
> I met some strange situation. In MainThread my program wating changes of
> some variable. This variable should be changed in another thread, but loop,
> which wait changing variable blocks all other threads.
> Code below:
>
> class class1:
> def __ini
14 matches
Mail list logo