I use Threads in an application developed for Windows and Linux. The one on the Windows version works very well. On the Linux version, the application freezes itself and sometimes crashes. The code is identical between both versions.
The source of the problem seems to be when you call an external function from the Thread procedure. Here is a sample:
Code: Select all
Procedure MyOtherFunction()
...
EndProcedure
Procedure MyThreadFunction(Param)
...
MyOtherFunction()
...
EndProcedure
...
ThreadId = CreateThread(@MyThreadFunction(), 0)
....
It works better when I desactivate the calling to MyOtherFunction(). It could be a stack problem when using Threads in the Linux version ?
I will try to give later a more complete code sample to illustrate.
PureBasic: one of the best programming tools ever ! PB is light, easy, crossplatform, powerfull, fast, extendable, enjoyable and... tasty
