On 14.09.2006, at 20:03, Vlad Seryakov wrote:

Can i do this from other thread, spawn in one and check in another,
actually this is what i need. I can have multiple processes running,
then according to some rules i will check which one is taking too long
and kill it.

Currently no as you can't operate on a proxy from other thread then
from the one you obtained it.

But I'm thinking loud...

There is a command [ns_proxy active pool]
It will give you such thing back:

server1:nscp 5> set proxy [ns_proxy get pool]
pool-7
server1:nscp 6> ns_proxy send $proxy "exec sleep 10000"
server1:nscp 7> ns_proxy active pool
pool-7 {exec sleep 10000}

A list of poolId/script. If we would expand the
[ns_proxy clear ?pool?]
to be
[ns_proxy clear ?pool ?handle??]
then you'd be able to:

   ns_proxy clear pool pool-7

and this will bruteforce close the slave. Any potential
waiter will exit with Tcl error and can examine errorCode
to see why it got kicked out.
This could be done from any thread.

Is this something suitable?

Cheers
Zoran



Reply via email to