1. Threads?
- Posted by Jonas Temple <jktemple at yhti.net> Oct 09, 2002
- 454 views
Rob, I know this has been discussed in the past but is there any plans in the near future for thread in Euphoria? I've recently had occasions where I could use threads in Euphoria, particularly for functions that could run a long time (database retrieval). Thanks, Jonas
2. Re: Threads?
- Posted by Robert Craig <rds at RapidEuphoria.com> Oct 09, 2002
- 434 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
3. Re: Threads?
- Posted by Kat <kat at kogeijin.com> Oct 09, 2002
- 451 views
On 9 Oct 2002, at 16:00, Robert Craig wrote: > > 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. Or use socks. Or DDE (windoze only?). Other than socks or dde, is there any way to signal the other process(es) that there is work to be done? Kat
4. Re: Threads?
- Posted by Robert Craig <rds at RapidEuphoria.com> Oct 09, 2002
- 476 views
Kat writes: > Other than socks or dde, is there > any way to signal the other process(es) that there is work to be done? Have a look at Jordah Ferguson's demo where processes pass Euphoria data to each other via shared memory. He uses a library developed by Mario Steele and Jason Mirwald. I think jbrown was doing something similar on Linux. A process could sleep() and periodically check a value in shared memory. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
5. Re: Threads?
- Posted by Kat <kat at kogeijin.com> Oct 09, 2002
- 440 views
On 9 Oct 2002, at 22:56, Robert Craig wrote: > > Kat writes: > > Other than socks or dde, is there > > any way to signal the other process(es) that there is work to be done? > > Have a look at Jordah Ferguson's demo where > processes pass Euphoria data to each other via shared memory. > He uses a library developed by Mario Steele and Jason Mirwald. > I think jbrown was doing something similar on Linux. > A process could sleep() and periodically check a value in > shared memory. Sleep()ing isn't the same as an event trigger. Kat
6. Re: Threads?
- Posted by jbrown105 at speedymail.org Oct 09, 2002
- 441 views
On 0, Kat <kat at kogeijin.com> wrote: > > On 9 Oct 2002, at 22:56, Robert Craig wrote: > > > > > Kat writes: > > > Other than socks or dde, is there > > > any way to signal the other process(es) that there is work to be done? > > > > Have a look at Jordah Ferguson's demo where > > processes pass Euphoria data to each other via shared memory. > > He uses a library developed by Mario Steele and Jason Mirwald. > > I think jbrown was doing something similar on Linux. > > A process could sleep() and periodically check a value in > > shared memory. > > Sleep()ing isn't the same as an event trigger. > > Kat > No, but it comes close to emulating it. Under *nix, you can also use signals as triggers, signals + shared memory should od the trick: the signal can be the event trigger and the shared mem can transfer the variable states shared between processes. (This is what I tried to do, but I was unable to solve the race condition which tended to corrupt the database. File locks and mutexes both failed for me, hence I resorted to socks.) Is there any similar mechanism to signals under Win32? You could use that as the event trigger. jbrown
7. Re: Threads?
- Posted by jbrown105 at speedymail.org Oct 10, 2002
- 439 views
I wrote: > Under *nix, you can also use signals as triggers, signals + shared memory > should od the trick: the signal can be the event trigger and the shared mem > can transfer the variable states shared between processes. (This is what I > tried to do, but I was unable to solve the race condition which tended to > corrupt the database. File locks and mutexes both failed for me, hence I > resorted to socks.) I should point out that signals are a type of communication between unix processes. One processes can signal another one, which will then stop whatever its doing to do run the code for the signal handler. After it returns, then the signalled program does back to whatever it was doing before. jbrown
8. Re: Threads?
- Posted by Robert Craig <rds at RapidEuphoria.com> Oct 18, 2002
- 432 views
Kat writes: > Other than socks or dde, is there > any way to signal the other process(es) that there is work to be done? Have a look at Jordah Ferguson's demo where processes pass Euphoria data to each other via shared memory. He uses a library developed by Mario Steele and Jason Mirwald. I think jbrown was doing something similar on Linux. A process could sleep() and periodically check a value in shared memory. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
9. Re: Threads?
- Posted by Kat <kat at kogeijin.com> Oct 18, 2002
- 449 views
WOW ,, i just now got this: On 9 Oct 2002, at 22:56, Robert Craig wrote: > > Kat writes: > > Other than socks or dde, is there > > any way to signal the other process(es) that there is work to be done? > > Have a look at Jordah Ferguson's demo where > processes pass Euphoria data to each other via shared memory. > He uses a library developed by Mario Steele and Jason Mirwald. > I think jbrown was doing something similar on Linux. > A process could sleep() and periodically check a value in > shared memory. > > Regards, > Rob Craig > Rapid Deployment Software > http://www.RapidEuphoria.com > > > >
10. Re: Threads?
- Posted by Elliott Sales de Andrade <quantum_analyst at hotmail.com> Oct 20, 2002
- 463 views
I got that on the 9th and today. On 19 Oct 2002 01:45:38, Kat wrote >WOW ,, i just now got this: > >On 9 Oct 2002, at 22:56, Robert Craig wrote: > > > > > Kat writes: > > > Other than socks or dde, is there > > > any way to signal the other process(es) that there is work to be done? > > > > Have a look at Jordah Ferguson's demo where > > processes pass Euphoria data to each other via shared memory. > > He uses a library developed by Mario Steele and Jason Mirwald. > > I think jbrown was doing something similar on Linux. > > A process could sleep() and periodically check a value in > > shared memory. > > > > Regards, > > Rob Craig > > Rapid Deployment Software > > http://www.RapidEuphoria.com Euphoria Instant Messenger Have YOU Joined? http://groups.yahoo.com/group/euim/
11. Re: Threads?
- Posted by jbrown105 at speedymail.org Oct 21, 2002
- 425 views
So did I. Why? On 0, Elliott Sales de Andrade <quantum_analyst at hotmail.com> wrote: > > > I got that on the 9th and today. > > > On 19 Oct 2002 01:45:38, Kat wrote > > >WOW ,, i just now got this: > > > >On 9 Oct 2002, at 22:56, Robert Craig wrote: > > > > > > > > Kat writes: > > > > Other than socks or dde, is there > > > > any way to signal the other process(es) that there is work to be done? > > > > > > Have a look at Jordah Ferguson's demo where > > > processes pass Euphoria data to each other via shared memory. > > > He uses a library developed by Mario Steele and Jason Mirwald. > > > I think jbrown was doing something similar on Linux. > > > A process could sleep() and periodically check a value in > > > shared memory. > > > > > > Regards, > > > Rob Craig > > > Rapid Deployment Software > > > http://www.RapidEuphoria.com > > Euphoria Instant Messenger > Have YOU Joined? > http://groups.yahoo.com/group/euim/ > > > > Linux User:190064 Linux Machine:84163 --