Problem with ThreadPool on os windows - no execution

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with ThreadPool on os windows - no execution

Sabine Manaa
Hi,

because of [1]  I use ThreadPool [2] and while developing on my mac it worked fine.
But now, testing it on my production server which is a windows machine, it does not work which means, it is some kind of magic, the code within the block 

[anObject doSomething]  queueWork is not run. When changing it to 
[anObject halt doSomething]  queueWork the code is run!

Changing my code from >>queueWork back to >>fork proves that everything is fine now and there is a problem with ThreadPool.

When I was playing around to find the problem, I noticed the following:

I created a button like this:

 html mdlButton onClick: (html jQuery ajax
script: [ :script |   | theSession |
theSession := self session.
[ theSession inspect ] queueWork.  ]);
with: 'test'

Mac: it works nearly immediately
Windows: it does not work ... except when I add a halt in it
but: When I then do this after clicking on the test button:

20 timesRepeat: [[ Transcript crShow: Time now printString]  queueWork ],

the sessions inspector also comes up

It seems that the process is hanging until the next work is to be done.

Before going deeper in it my question is:
does anyone use it on windows?
is it made for windows, too?
are there any experiences with windows and ThreadPool?
did I miss something?
how can I fix this?

Regards
Reply | Threaded
Open this post in threaded view
|

Re: Problem with ThreadPool on os windows - no execution

Paul DeBruicker
Hi Sabine,

There shouldn't be any differences between the platforms.  Maybe I broke something in the update recently where I make the pool start/stop based on whether it has any jobs.  You could try the older version that starts the pool on startup and report back if it works or not.

Seems strange that having a halt in there makes it run.  


Another thing you could do with the current version is open the process browser (e.g. World Menu > Tools > Process Browser) and set it to auto-update then run something like:


1000 timesRepeat:[[100 milliSeconds wait. 1+1] queueWork].

And see if it the ThreadPool wakes up and runs them. If it is working a number of processes that start with the name  "pool:"   will appear in the list.  And then disappear.    Up to 15 I think.


And I haven't tried the new code on anything but Pharo 5 and don't plan to for a while but would be surprised if that was important.  

Sabine Manaa wrote
Hi,

because of [1]  I use ThreadPool [2] and while developing on my mac it
worked fine.
But now, testing it on my production server which is a windows machine, it
does not work which means, it is some kind of magic, the code within the
block

[anObject doSomething]  queueWork is not run. When changing it to
[anObject halt doSomething]  queueWork the code is run!

Changing my code from >>queueWork back to >>fork proves that everything is
fine now and there is a problem with ThreadPool.

When I was playing around to find the problem, I noticed the following:

I created a button like this:

 html mdlButton onClick: (html jQuery ajax
script: [ :script |   | theSession |
theSession := self session.
[ theSession inspect ] queueWork.  ]);
with: 'test'

Mac: it works nearly immediately
Windows: it does not work ... except when I add a halt in it
but: When I then do this after clicking on the test button:

20 timesRepeat: [[ Transcript crShow: Time now printString]  queueWork ],

the sessions inspector also comes up

It seems that the process is hanging until the next work is to be done.

Before going deeper in it my question is:
does anyone use it on windows?
is it made for windows, too?
are there any experiences with windows and ThreadPool?
did I miss something?
how can I fix this?

Regards
Sabine

[1]
http://forum.world.st/ThreadPool-with-Seaside-how-td4956812.html#a4957192
[2] http://smalltalkhub.com/#!/~pdebruic/ThreadPool/