Re: Threads?
- Posted by Robert Craig <rds at RapidEuphoria.com> Oct 09, 2002
- 432 views
Jonas Temple writes: > I know this has been discussed in the past > but is there any plans in the near future for > thread in Euphoria? Not in the near future. There are a lot of thorny issues regarding threads, and only a small percentage of people would likely use them. It would be an interesting thing to do at some time. One thorny problem is the issue of "thread-safe" library routines. Many C library routines, as well as some Euphoria run-time routines are not necessarily "thread-safe". For example, if one thread was executing in the middle of malloc(), and then control passed suddenly to another thread which then called malloc(), you could corrupt the heap. I think the Microsoft compiler has a version of the C run-time that is thread-safe, and another (faster one) that isn't. > I've recently had occasions where I could use threads in Euphoria, > particularly for functions that could run a long time (database > retrieval). You can today, run multiple Euphoria *processes*, i.e. separate programs, which can communicate via files or shared memory. This gives you parallelism, but at a coarser level than threads, i.e. the context switching is slower. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com