Advertisement

AngelScript: Suspend vs Abort

Started by July 18, 2024 08:49 AM
1 comment, last by WitchLord 2 months ago

After many years I find myself once again working with AngelScript for my current project. It's like meeting an old friend, and just as enjoyable to work with as before.

Anyway, for this project I'm running some script contexts in a separate thread, and allowing the user to pause and resume them. The user can also just abort the running script completely. Everything is working fine, but I'm curious about whether there is any difference between Suspend and Abort (other than the obvious, that Suspend allows for continuing). So far I cannot tell any difference, eg. if I do Suspend and then Release, is exactly the same as if I do Abort and then Release.

It might seem like a trivial nitpick, but these scripts will be controlling a pick-and-place machine which could be moving at up to 1m/s, and must be able to emergency stop. So I'm just trying to understand a bit deeper, if there are any quirks that could be important to be aware of in this scenario. I guess what this boils down to is: does Abort stop the script quicker than Suspend?

Hello again. Welcome back to AngelScript. 🙂

There is indeed no significant difference between the two, other than the state. Basically the difference is to tell the application why the Execute() call ended and whether or not the execution can be resumed.

Both will be exactly the same in terms of time to stop the execution.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement