Re: Threads [Was: Re: 64 bit euphoria]

new topic     » goto parent     » topic index » view thread      » older message » newer message

codepilot Gmail Account wrote:
> 
> On 4/28/05, Jason Gade <guest at rapideuphoria.com> wrote:
> >
> >
> > posted by: Jason Gade <jaygade at yahoo.com>
> >
> > codepilot Gmail Account wrote:
> > >
> > > 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
> >
> > Right, I forgot to mention.  If using simulated threading the programmer =
> must ensure that no thread blocks or takes an excessive amount of time to r=
> un.  It basically boils down to cooperative threading.


> If the interpreter has simulated threads, then threads can't take too
> long(cause there each given a number of instructions), but a blocking
> call will stop them all.
> Dan

Okay, I'm thinking more along the lines of a master loop that keeps a queue of
threads to run, calls each of them in turn (and each thread is specifically
written to *not* block and to only do a small piece of work before returning). 
Each individual thread knows where it is in its work and whether it is finished.

Kind of like Langwar (which I haven't looked at in a long time).

=====================================
Too many freaks, not enough circuses.

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu