#Task halt w/ Forbid()?
9 messages in this thread
I'm trying to halt all tasks. I tried using Forbid(), but that didn't
seem to have any effect. Is there any way to take control of the
system? Specifically, I want to halt AmigaVision on some trigger,
like a joystick button being pressed. Any pointers to code
appreciated.
I thought Forbid() would do the trick. I wonder if it is stubbed out in this
library I'm using?
-Jerry
Forbid only prevents the system from task switching as long as you don't
give up your slice of the CPU. There are lots of ways to accomplish
locking up the system, but I am not sure that you will accomplish what you
want. What do you mean 'halt' AmigaVision? If you mean make it stop
running while the rest of the system goes on, you might consider the
following technique:
Change the task priority of AmigaVision to something low like -50.
Create a slightly higher priority task like -45 or the like. Run an
infinite loop in the higher priority task. You can then cause
Amigavision to 'stop'. To make it run again, either raise the
priority of AmigaVision or make the other task pause.
Ah. I'm doing a Wait() right after the Forbid(). That explains that.
I don't really want to tie up the entire machine with a busy wait, but I
think that would do the trick.
I found a program here on CIS called FREEZE which does halt a task. I
changed my code to exec FREEZE in place of the Forbid(), but FREEZE
doesn't find AV as a Task. FREEZE recognizes some CLI, processes, and
tasks, but not all. Strange.
I don't know what FREEZE is doing. Possibly changing the exec task list
to remove and insert the task from the list. It looks like just what I
need but it won't recognize AV and there wasn't any source code with it.
Thanks for the suggestion of the busy wait. Would I have to lower the AV
priority or would raising my priority above AV's be sufficient?
-Jerry
Better lower AV's priority, the system can get weird when apps have higher
priority than, say, the input device.
Okay, Thanks.
BTW, someone told me that earlier versions of the AVPro Player would
allow you to pause the flow with the right mouse button. I have
access to a very early AVPro and I am going to try the player from
that. Bummer. Just when I thought I was going to have an excuse to
write some code. I got sick of writing interactive videodisc device
drivers in assembler and started only doing high level scripting and
multimedia authoring. Now I'm kind of missing all the low level C
and assembler. I guess it has just been so long that I forgot how
much of a pain it is.
-Jerry
You could do some ARexx programming, I always found that useful with
AmigaVision. It's not C or asm, but it is programming.. sort of.
I do some ARexx coding, mostly for things like ADPro and AmigaVision.
Actually you helped me with ARexx code about three years ago when I
was doing a voice controlled Toaster project, which was a lot of
fun. I was thinking more along the lines of blitter operations,
copper lists, and low level code to trash my SCSI devices.
I finally found most of my C and assembler manuals, but I can't find
my "Inside the Amiga with C." Going through the AutoDocs is fine
when you already know how to do something.
I just solved my PC problem today (friggin EMS) so I'll have to shelve
any recreational programming projects for a while. I have a lot of
paid programming work to do first, which is good. (C'mon 6… baby
needs a new pair of brake shoes…)
Forbid() should lock out other tasks (but not interrupts) but if your
program does a Wait() it will suspend the Forbid() state. According to the
autodocs, any DOS or Device I/O can cause a Wait().
Peter Wade
Autopiloting from London, England
Yeah, that's exactly what my program did, Forbid() then Wait().
Oops.
-Jerry