|
Greg Smalter Newbie
Joined: 16 Feb 2001 Posts: 9
|
Posted: Fri Feb 14, 2003 4:31 am
Concurrency issues with triggers. |
I recently discovered that the execution of triggers can be interleaved, such that the assumptions that one of my triggers makes are false because the trigger firing off the previous line has not finished executing.
Is there a mechanism to force a trigger to execute as an atomic operation, or do I have to implement my own mutex manually? Are there any other approaches to the problem?
Thank you. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Feb 14, 2003 12:49 pm |
This normally happens when you have long loops in your triggers. To solve this, enclose any section of code that you want to execute before any other trigger fires in the #PRIORITY command. Example:
#PRIORITY {hihg-priority code here}
Kjata |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Fri Feb 14, 2003 12:51 pm |
zMUD does have a way to take care of this issue for you, implemented in version 6.37 so it is in the latest public version (6.40) but not 6.16.
Check out the #PRIORITY command. It is used to specify that no other triggers be processed while it is executing.
Edit: I had this typed out and ready to post before I forgot to post it for 15 minutes and Kjata beat me to it :P
- Charbal |
|
|
|
|
|