Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.tech Subject: Re: INTUITICKS Problem! Message-ID: <16634@cbmvax.commodore.com> Date: 18 Dec 90 16:14:31 GMT References: <1990Dec17.220906.15730@hoss.unl.edu> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Organization: Commodore, West Chester, PA Lines: 33 In article <1990Dec17.220906.15730@hoss.unl.edu> 252u3130@fergvax.unl.edu (Phil Dietz) writes: >I'm writing a program that does a BUNCH of calulations (3d ray trace >stuff). Well as it turns out, if I put the calculation part of the >program in a CASE INTUITICKS: loop, it runs 10% faster than if I just >let it run (and not be multi-tasking happy!) Weird.... The system will take care of multitasking. You don't have to voluntarily give up the processor in order to be multitasking-friendly. The Amiga is a pre-emptive system, which means that after the right amount of time, your task will be pre-empted if someone else is ready to run. The key principle of being multi-tasking friendly is not to avoid being busy, but to avoid being busy doing nothing. So, if your program has work to do, do the work, but if you're waiting for some event (eg. a signal or a message), then use the Wait() or WaitPort() command, instead of running in a tight loop checking the condition. >Now the problem is, if I use the INTUITICKS trap, the WINDOW ALWAYS HAS >TO BE SELECTED!! If the window isn't selected it just hangs at the spot >until I re-activate it. Whats going on? Is there a way around it? INTUITICKS are only sent to the active window. You can set up requests with the timer.device that you'll hear all the time. But as explained above, you don't need this (at least not for the use you describe). >Phil Dietz Peter -- Peter Cherna, Software Engineer, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.commodore.com My opinions do not necessarily represent the opinions of my employer. "Oh, PIN-compatible! I thought you wanted me to make it IN-compatible!"