The remaining piece is where do i get refID when i want to unref? or how do I store that refID with the co routine?
Here are some of the possibilities/issues i have run into.
- Environment table
I have multiple co routines sharing an environment which dosn't allow me to uniquely store this value,
without another table which is undesirable from a complexity/performance standpoint
- Stack
Since the new stack is the only thing completely unshared when creating a co routine, I simply push the value onto the stack.
This works like a charm until an error case, errors leave the stack in the layout of the function that ran into the problem.
In this case i do not know how to recover the refID to properly clean up.
Thoughts about my specific issues?
Other suggestions/approaches that i haven't mentioned?
Performance is a big concern to me with that in mind I'm curious how you guys would solve/layout something like this.
-Chris