A Question about Procedures in Threads
Posted: Wed Sep 21, 2016 11:51 am
Is it possible to safey call a procedure from within a thread? I am doing this but I have apparently random memory read errors (including at the ProcedureReturn point), which makes me think it might be a stack corruption problem, or at least a memory problem. On a computer with a large memory the problem will always occur though sometimes after many, many iterations. On an old computer with a small memory it will occur after only one or two. I haven't done anything completely stupid like foregetting to set ThreadSafe and I use LockMutex() to ensure that shared Global arrays are not accessed at the wrong time. I believe the code itself is robust. I cannot divorce the code from its program to post it, and in any case event the helpful PureBasic community might draw the line and running something for several hours before the error occurs!
I would appreciate any suggestions.
I would appreciate any suggestions.