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. --- include/arch/tcb.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/arch') diff --git a/include/arch/tcb.h b/include/arch/tcb.h index 4e82ab1..115f49d 100644 --- a/include/arch/tcb.h +++ b/include/arch/tcb.h @@ -32,6 +32,13 @@ void tcb_assign(struct tcb *t); */ void setup_rpc_stack(struct tcb *t); +/** + * Free memory backing rpc stack. + * + * @param t Thred whose RPC stack should be destroyed. + */ +void destroy_rpc_stack(struct tcb *t); + /** * Maximum size of one individual RPC stack instance. * -- cgit v1.3