Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Greg Smalter
Newbie


Joined: 16 Feb 2001
Posts: 9

PostPosted: 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.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net