Re: Threads [Was: Re: 64 bit euphoria]
- Posted by codepilot Gmail Account <codepilot at gmail.com> Apr 28, 2005
- 497 views
Way back when I made my own eueu, it was simulating multithreading. It would make multiple instances of the local variables, and make the globals global. It would call do_instuction a few times, then switch_instance, and do_instruction some more. If threading was simulated at the interpreter level, like mine, then the parser situation would be alleviated, and no real threading/locks/reentracy checking would be necessary. Buy interpreter simulated threads would still stop all threads for blocking calls. Dan On 4/28/05, Jason Gade <guest at rapideuphoria.com> wrote: > > posted by: Jason Gade <jaygade at yahoo.com> > > Matt Lewis wrote: > > > > Jason Gade wrote: > > > > > > <snip much talk about threads> > > > > > > First let me say that I really don't think that Euphoria needs thread= s. I don't believe > > > that the language needs the extra complication. > > > > > > Any program that needs simulated threads instead of multiple processe= s can make an > > > event loop and set up either round-robin or timer callbacks. > > > > > > > The real argument for threads, IMHO, is that the current thinking is th= at > > we're at a virtual dead end as far as processor performance goes, and t= he > > future is in multi-cored machines, which a single thread can't take > > advantage of. It's perhaps not Euphoria's most common use, but for tho= se > > of us who do calculations or simulations in Euphoria, this could be rea= lly > > important. Multiple processes are an option, but may not be the easies= t > > or best way to implement a given algorithm. Not to mention the backgro= und > > processing that a game might be doing. > > > > And while processes are cheaper than threads in the Win32 realm, it's n= ot > > so in the *nix universe. > > > > Matt Lewis > > > > Aren't threads lightweight processes by definition? I think that threads= are "cheaper" than processes in any context. > > But I think you are right in that processes are cheaper in win32 than in = *nix. But *nix has a longer history of multi-processing (background proces= ses) than in threads. > > I think for games, the simulated approach would still probably be best. = But I do understand that scientific simulation usually uses threads. I cer= tainly don't know much about it, though. > > Are there enough people doing complex simulation in Euphoria to make it w= orthwhile? Are there better tools than Euphoria for the job? > > I'm not really against it as long as it is kept simple; I just see little= need for it by the majority of users. And as I said in another post, Euph= oria has some things that are more important to implement or fix first. > > ========================= ============= > Too many freaks, not enough circuses. > > j. > > > > >