 |
divido Newbie
Joined: 21 Oct 2003 Posts: 3 Location: USA
|
Posted: Tue Apr 20, 2004 7:41 am
Obessive Compulsive Triggers |
I noticed on my old computer that zMUD was sometimes executing trigger scripts out of order. Meaning, if two lines are sent and they both match different triggers, sometimes the second would complete before the first. I assume this is because of a multi-threaded trigger parsing module/engine. On my new computer, it is not an issue, since triggers resolve much faster than they come across the network. I do not rest well at night with my triggers banking on a race condition that I'm only reasonably confident they'll win. Is there a way to turn off the multi-threadedness? Perhaps a cleaner way to synchronize between triggers?
|
|
|
 |
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Tue Apr 20, 2004 9:34 am |
The erratic behaviour of your triggers could simply be due to the commands they execute. That is to say, in any case your triggers will still all fire in the same sequence, except that they may execute commands concurrently or complete their execution out of tune.
The problem usually lies with looping commands such as #forall, #loop, #while, #wait etc. They substantially slow down the speed with which each trigger produces results.
For example, running 10 #IF statements is much quicker than running a single #LOOP statement when used in an algoritm to remove excess double spaces in a string.
The solution is to use the #PRIORITY command, it is invaluable when dealing with such triggers in your script. |
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|