Remove a task with RemTask, possible ?

3 posts / 0 new
Last post
zzd10h
zzd10h's picture
Offline
Last seen: 7 years 4 weeks ago
Joined: 2012-08-24 20:56
Remove a task with RemTask, possible ?

Hi,
I read on Internet in old docs or in some forums that it was not safe to remove others tasks with Exec/RemTask.
I have tried it, and it's seems true, my system become unstable each time I remove a task.

Is somebody have an idea if it's possible with RemTask (or another function) to remove a busy or frozen task ?

Many thanks by advance for your answer,
zzd10h

hypex
hypex's picture
Offline
Last seen: 4 months 2 days ago
Joined: 2011-09-09 16:20
No it's not safe and

No it's not safe and downright rude to remove other tasks because your program does not OWN them! :-)

The only safe way is for the other programs tasks to terminate or for the system to remove them for you.

However, in AmigaOS, there is not only tasks but processes. Tasks are more low level, suited to device drivers and can't use some DOS functions or other functions. Processes have extended functionality and can call all functions. A normal application would run as a process.

Now, that said, assuming a task (or process) is causing you trouble the best course of action would be to try a utility like Scout. First try to send it break signals. If that fails you can freeze the task or tell it to remove it.

Now as this is a programmers forum I take it you want to be able to do this yourself? IOW duplicate what Scout would do. You could perhaps do a bit of task hacking and change its fields to modify its behaviour. For example cause it to be kicked off the running/ready list so it is put onto a non running list. Or brutally lower its priority. Don't recall what functions OS4 has but you could also try to kick it off as the running task by adding an interrupt server, such as vertical blank, and in interrupt check for the task then call the Switch() routine on it if found.

zzd10h
zzd10h's picture
Offline
Last seen: 7 years 4 weeks ago
Joined: 2012-08-24 20:56
Thank, Hypex, for the

Thank, Hypex, for the confirmation.
Yes, it was for a program (SysMon on os4depot).
I have the freeze option and I wanted to know if it was possible to remove task (or process).
Therefore, I will just keep the Freeze option.

Thanks again

Log in or register to post comments