Re: Threads [Was: Re: 64 bit euphoria]
- Posted by Mario Steele <eumario at trilake.net> Apr 29, 2005
- 533 views
Several things to note here, both on Emulated Threads, and the Hyper Threading stuff. First off, Emulated Threads. Yes, this is a great idea, till you run into 1 small problem. You hit a litteral brick wall, when you attempt to use C API, that is a BLOCK call. Your whole program stops, even when running emulated threads, and your program won't do anything, till that call is finished, and during which time, it is very well possible, if not definate, that the entire thread system will get knocked out of balance, and causing some fatal errors. If you do not belive it yourself, test it with any of the BLOCKING calls of the Winsock library, or even File I/O, let alone any C/C++ API that does not return control to the caller, till it has finished. You will see, that this will throw everything right out the door. As for Hyper Threading, and Wrapping Thread ideas. Yes, this can be done. Can it be done safely? No. Will it actually work? Most likely not. Why? Cause Euphoria isn't designed to be Thread Safe. It isn't designed to have multiple instances of Euphoria code, to be running con-currently. In other words people if prodcedure a was called, it will not allow procedure b to be called, or executed till a is finished. And therefore, that leads us back to the entire point of Threads in Euphoria. Rob has said this, and I'll say it again. Euphoria cannot do threads naturally, till Threads are implemented at the Interpreter Level, and not as emulated, but true Threads. For the simple fact, that the interpreter is only concerned for running the current instruction, and accomplishing it, before moving on to the next instruction. That is the entirety of needing threads in Euphoria. *steps off the podium, and walks away* Mario Steele http://enchantedblade.trilake.net Attaining World Dominiation, one byte at a time...