Stopping threads from the outside
Peter Hansen
peter at engcorp.com
Mon Mar 25 19:26:59 EST 2002
holger at trillke.net wrote:
>
> The Agent "servers" don't do much on themselves
> but instead leave it to agents to provide "framework" and protocol
> capabilities. So to decouple the agents i would probably
> introduce a "RelationShip"-Agent managing couplings between
> them.
Exactly the approach I would take. Make the environment
(I use that term to mean the surroundings for the agent)
act as a proxy to any other agents that one agent wants to
talk to, thus ensuring all agents run isolated from the
others and, coincidentally, forcing them to call through
your environment when necessary, thus giving you the
ability to intercept those calls and even terminate
the agent by raising an exception (provided they don't
blindly ignore such exceptions). Phew... sorry for the
run-on sentence...
> > a low-performance hack until you have time to implement the
> > modification in the interpreter :-), which would be to
> > stick a flag check into a routine inserted with sys.settrace().
>
> interesting suggestion! Doesn't this cause a lot of overhead unless
> done in C?
Oh very likely! I did say it was "low-performance". Just a
thought that might give you some ideas.
-Peter
More information about the Python-list
mailing list