Page 2 of 2
Posted: Sun Mar 09, 2008 9:23 am
by piranha
Does mine require an interrupt? I'm just calling switch tasks....
-JL
Posted: Sun Mar 09, 2008 11:58 am
by lukem95
i think it was meant that it would require an interrupt if being called from an external application, and therefore using a syscall.
Posted: Wed Mar 12, 2008 7:31 pm
by Ready4Dis
I delete tasks in my idle function, and just skip/bypass them in my task manager (I am probably going to start using a seperate kill list, just incase the system is really busy and doesn't delete them fast). This means, I am not wasting many cylces or extra switches to kill tasks, it is marked for deletion, then when my idle function is called, it will check if there is anything ready for deletion, it only deletes one task at a time and then relinquishes it's time, so it will never try to take much time away from the OS if it's busy, and since my idle loop is in kernel mode, there is no extra context switch. Works good for me thus far, and when it's really busy the tasks will just sit and wait to be removed until the system has some time (although, my idle function gets called for at ~1ms every once in a while, so they will slowly dissappear even if busy, but it will never turn interrupts off for long, or take much CPU away from more important things).
Posted: Thu Mar 13, 2008 3:02 am
by pcmattman
My kill function sets the process status to "DEAD". DEAD processes are removed after each "round" in my round-robin scheduler.
The kill function also cleans up the address space - freeing all non-kernel pages and the page directory itself. This way I don't need to have any special code to unload binaries, which saves time
. It probably isn't the best place, but it works.