www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/21/17:01:22

Sender: nate AT cartsys DOT com
Message-ID: <371E3CB8.9BEF72C@cartsys.com>
Date: Wed, 21 Apr 1999 14:01:44 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.5 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Multi tasking?
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990420122556 DOT 841T-100000 AT is> <7fi9tj$nef$1 AT camel29 DOT mindspring DOT com>
Reply-To: djgpp AT delorie DOT com

Lark wrote:
> 
> Eli Zaretskii wrote in message ...
> >
> >On Sun, 18 Apr 1999, Lark wrote:
> >
> >> How would I go about accomplishing multitasking?
> >
> >Please explain more what exactly do you mean by that.  One
> >interpretation is that several programs run at the same time sharing
> >the machine resources; another interpretation is that you have several
> >threads of execution in the same program.
> 
> This is more of what I had in mind, the multiple threads in the same
> program.  Surely it can't be impossible.  How would people make games where
> spaceships explode at the same time that other ones are still shooting, etc?
> Thanks for the feedback.

You don't need any sort of multitasking or multithreading for that. 
Just:

* Figure out what ship A should do
* Figure out what ship B should do, etc.
* Put it all together
* Draw a frame to the screen.

Just because entities are doing different things at the same time
doesn't mean their controlling code is also running simultaneously or
pseudo-simultaneously.

-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019