Re: windows threads work!!
- Posted by Robert Craig <rds at RapidEuphoria.com> Jul 11, 2006
- 702 views
jacques deschĂȘnes wrote: > Maybe Robert Craig could confirm my hypothesis about static linkage of CRT in > exwc.exe exwc.exe (and exw.exe) are compiled with Watcom C, and they statically link with Watcom's standard C library. You might be able to get O/S threads working in a few small programs, but there are some major problems that will prevent operating system pre-emptive threads from working *reliably*. As you are aware, the C run-time library needs to be thread-safe, but Watcom's library is not. On top of that, Euphoria's run-time routines are not thread safe. For instance, Ref() and DeRef() operations are performed all over the interpreter. If the O/S were to pre-emptively switch to another thread in the middle of a Ref or DeRef, the reference count on an object could get messed up, eventually leading to a storage leak or a crash. A program might run a hundred times successfully before crashing mysteriously on the hundred and first run. I'd probably have to abandon reference counting, and go to garbage collection, as one step in supporting preemptive O/S threads. (Remember that Euphoria 3.0 pre-alpha already supports *cooperative* threads (tasks)). Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com