Implement hash table for child process results

This commit is contained in:
2024-11-15 16:37:42 +00:00
parent 222aeff90f
commit 2566948a32
3 changed files with 90 additions and 77 deletions

View File

@@ -44,7 +44,7 @@ struct process_result
struct lock lock; /* Lock the exit_status and sema. */
struct semaphore sema; /* Semaphore to signal the parent that the exit_status
has been set. */
struct list_elem elem; /* List element for the parent's children list. */
struct hash_elem elem; /* Hash element for the parent's children map. */
};
/* A kernel thread or user process.
@@ -128,8 +128,8 @@ struct thread
/* Process wait properties. */
struct process_result *result; /* Result of the process. */
struct list child_results; /* List of children's of this thread
process results. */
struct hash child_results; /* Map of children's of this thread
TID to process result. */
struct file *exec_file; /* Thread's currently running file */
/* Shared between thread.c and synch.c. */