From 07c2376702fb3d508d6ffad6b0ce93b83972ad6e Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 4 Jul 2024 19:25:12 +0300 Subject: add zombie and orphan threads + Should write this down somewhere but the idea is that when a process gets killed, it frees all the memory it can, making all threads within that process orphans. Orphaned threads are assigned to the init process, which will generally call exit() on each one. Zombie threads are threads that own some bit of shared data, and whose reference count is above zero. They may not be swapped to or called, even though they take up space in thread map and reserve their thread ID. --- src/ipi.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ipi.c') diff --git a/src/ipi.c b/src/ipi.c index e9bc4d3..d00ba1c 100644 --- a/src/ipi.c +++ b/src/ipi.c @@ -26,6 +26,11 @@ void send_ipi(struct tcb *t) cpu_send_ipi(t->cpu_id); } +void unqueue_ipi(struct tcb *t) +{ + queue_del(&t->ipi_queue); +} + void handle_ipi() { struct tcb *t = cur_tcb(); -- cgit v1.3