|
killergate Novice
Joined: 16 Feb 2009 Posts: 38
|
Posted: Mon Aug 23, 2010 9:12 am
[3.22a] Random total freeze of CMUD |
Hi,
Occaisionally I've had CMUD freeze entirely on me in different situations - having some settings windows open or just from playing a mud and in main windows - is there any way I can debug this? I have to kill the CMUD process to get it working again.
/kg |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Aug 23, 2010 3:56 pm |
Without a lot more information there's not a lot of insight we can provide. You best first bet is to run the Debugger window in the background to see what's going on.
Is your CPU maxed out when this happens? Do you use #WAIT or #SECTION in any of your code? Is there a particular thing you seem to be doing? Does it happen when you work offline? You can also try disabling some triggers to see if it occurs then. |
|
_________________ Asati di tempari! |
|
|
|
killergate Novice
Joined: 16 Feb 2009 Posts: 38
|
Posted: Mon Aug 23, 2010 9:04 pm |
Hi,
Ill try to run the debugger, but I have a feeling that it will freeze up too, and I will not be able to bring it to front. But Ill try it.
I've recently cut down on using #wait in the code, but added a couple of #section paragraphs - can that cause total freezes - ie. a hung CMUD?
And nope, my CPU isnt maxing out or anything during this.
/kg |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Aug 23, 2010 9:20 pm |
Yes, #section can definitely cause a hard hang if you use it improperly. The problem is if you ever get "nested" #section commands. For example:
Code: |
#ALIAS test1 {#section test {do something}}
#ALIAS test2 {#section test {test1}} |
In this example, if you run "test2" you will get a hang. This is because test2 starts a #section, then calls the "test1" alias which also tries to start the same #section. When test1 executes #section it sees that it is already in use and it waits indefinitely until the section becomes available. But since the test2 alias never finishes, it never lets go of the section. So you get a hard hang. With a thread lock like this, all you can do is kill the process using the Windows task manager.
So when using #section, be sure to put it around the minimal amount of code that needs protection and it's usually a bad idea to call any other functions or aliases or commands from within a section. You should only use it to protect the reading and writing of shared global variables across multiple threads. |
|
|
|
killergate Novice
Joined: 16 Feb 2009 Posts: 38
|
Posted: Tue Aug 24, 2010 7:15 am |
Hi,
I was using #section to protect some #signal'ing - but I dont really know if thats nesesarry.
/kg |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Aug 24, 2010 4:36 pm |
No, I don't think you need to protect #signal with #section. In fact, it's probably a bad idea since issuing a #signal is usually used to indicate that your thread is finished and to activate some other thread that is waiting on the signal. If you have a thread waiting on a signal, and the #signal command is in a #section, and it's waiting on the #section to become available, you might never execute the #signal. So again you might have a situation with different threads are waiting on things to occur that never do.
|
|
|
|
|
|