Re: Someone changed my Thread Manager writeup?

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

Al Getz wrote:
> 
> Hi again Pete,
> 
> Ok, that was the short reply :)
> I guess it just pisses me off when some people give something about
> three seconds of thought before they start rattling off bad points
> about something.  

<snip>

> I said it used preemptive MT because once the time slice is up
> another thread can break in.  preemptive MT doesnt imply an order.
> If you dont like that, then call it pseudo preemptive MT'ing :)

Fine, but that's about the same reason why we are all saying that you're 
wrong.  This is cooperative multitasking, at best, though even that is
stretching things a little bit.  Look at these links to see why everyone
keeps telling you that you're not doing preemptive multitasking:

http://en.wikipedia.org/wiki/Preemptive_multitasking
http://en.wikipedia.org/wiki/Co-operative_multitasking

> >I guess i could add a scheduling mechanism if that would make more
> > >people happy :)
> > I'd be very surprised if you could.
> What would be so surprising about that???

The way your code works now, there's not really a way to add on a generic
scheduling mechanism that would allow different threads to do work for
whatever timeslice they're given.  The closest you could probably get would
be to set up some timers and use that as your scheduling mechanism.  Or,
you'd end up with a langwar style scheduler, which seems to me would be 
a very different beast than your current method of yielding to GUI/OS
events.
 
> There's lots of things this doesnt do that 'real' threads can do,
> such as wait for another thread to complete before continuing, but
> that would add more code too.  This addresses the most basic problems
> that come up from not having any threads at all (at least until Rob
> completes his task of adding some sort of threads to Eu).
> 
> Im using this now all the time, and i certainly wouldnt use it
> if it didnt work, or didnt provide a decent amount of functionality
> over not having it.

No one has said that it isn't a valid way to prevent a long running task
from blocking the GUI.  In fact, we've all said that we do this all the
time, just without the explicit TimeSlice construct.

Matt Lewis

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

Search



Quick Links

User menu

Not signed in.

Misc Menu