01.03.2013, 21:51
I think we are on a different understanding of what loops are here.
I have myself had problems with lockups - situations where the script thread of the SA-MP server is stuck doing something over and over, but the network thread is running (and accepting connections and trying to have the script thread handle them without any luck). In these cases, all that can be done is a simple restart.
There are a few ways to approach this. One would be, as Vince already pointed out, adding debugging to loops in your code to see if that might be the fault. If it is, then it is easily detectable and you're lucky it happens at your script's level.
However the more plugins you use, the larger the potential chance of issues caused by them. Bugs can occur and sometimes it is hard to trace them down (crashdetect does not catch these of course), but if you're on linux, run your server in gdb and that will help you a great deal to see what's going on. Or you can also try attaching strace to your server process.
I have myself had problems with lockups - situations where the script thread of the SA-MP server is stuck doing something over and over, but the network thread is running (and accepting connections and trying to have the script thread handle them without any luck). In these cases, all that can be done is a simple restart.
There are a few ways to approach this. One would be, as Vince already pointed out, adding debugging to loops in your code to see if that might be the fault. If it is, then it is easily detectable and you're lucky it happens at your script's level.
However the more plugins you use, the larger the potential chance of issues caused by them. Bugs can occur and sometimes it is hard to trace them down (crashdetect does not catch these of course), but if you're on linux, run your server in gdb and that will help you a great deal to see what's going on. Or you can also try attaching strace to your server process.