Question on cog termination:
andrewsi
Posts: 59
Let's say you have a task that you want to run in a separate cog because it's potentially lengthy (e.g. a long lock on a semaphore) and you don't want to block your main cog's execution, but you want it to terminate when it's complete and release its cog back to the pool. (Perhaps this is all faulty program design on my part, but bear with me for a moment. :smilewinkgrin:)
Will the cog be returned to the pool automatically when its method's execution ends, or will it remain "assigned" indefinitely unless something explicitly calls Cogstop on its Cog ID?
Thanks-
Andy
Will the cog be returned to the pool automatically when its method's execution ends, or will it remain "assigned" indefinitely unless something explicitly calls Cogstop on its Cog ID?
Thanks-
Andy
Comments
Just use COGSTOP(CogID) at the end of the method, to shut itself down.
-Phil