Commit Graph

68 Commits

Author SHA1 Message Date
Demetriades, Themis
25ca7b6522 Merge branch 'task1/themis/priority-donation' into 'task1/priority-donation'
Merge task1/themis/priority-donation into task1/priority-donation

See merge request lab2425_autumn/pintos_22!13
2024-10-23 15:03:07 +00:00
Themis Demetriades
5f8dea21be Fix donate_priority to disable interrupts for entire update of possibly-ready donatee's priority 2024-10-23 14:10:48 +01:00
Themis Demetriades
b0074c80f0 Refactor ready_list_reinsert to require being called with interrupts disabled 2024-10-23 13:51:07 +01:00
Themis Demetriades
2cd4da17a4 Refactor donate_priority to only allow for the current thread to donate its priority 2024-10-23 13:42:36 +01:00
Themis Demetriades
a875d5fcb4 Update donate_priority to only attempt to sort position of the donee that isn't waiting for a lock 2024-10-23 13:37:43 +01:00
sBubshait
d82176a2e2 Refactor lock release to follow PintOS indent style and use list functoins, w/ T 2024-10-22 22:52:29 +01:00
Themis Demetriades
7aec2e6862 Refactor donate_priority to include comments explaining its purpose and logic w/ S 2024-10-22 21:15:30 +01:00
sBubshait
78c6fd36e3 Refactor sema_up to add comments for clarity, w/ T 2024-10-22 21:04:14 +01:00
Themis Demetriades
48104b3a41 Refactor cond_signal to add comment clarifying the logic w/ S 2024-10-22 20:57:18 +01:00
sBubshait
5549b9c0cb Refactor thread recalculate priority to add comments for clarity, w/ T 2024-10-22 20:52:52 +01:00
sBubshait
bf6104200c Refactor thread set priority to remove unused variable and add comment, w/ T 2024-10-22 20:47:34 +01:00
Themis Demetriades
6983ccdd3b Update thread_get_priority description comment to be more specific w/ S 2024-10-22 20:41:44 +01:00
Themis Demetriades
fc1691f994 Refactor thread.h to remove superfluous thread priority comparison function w/ S 2024-10-22 20:36:37 +01:00
sBubshait
244db41434 Update condvar to use linear search due to changes in priority from donations, w/ T 2024-10-22 20:25:13 +01:00
Themis Demetriades
21cbfc9fe0 Implement transfer of orphaned donors when releasing lock w/ S 2024-10-22 20:06:21 +01:00
sBubshait
d9b9572631 Fix Bug in recalculating priority, uses 'elem' instead of 'donor_elem', w/ T 2024-10-22 19:49:53 +01:00
Themis Demetriades
a19d40bcca Reformat priority_more to obey code style 2024-10-22 19:01:55 +01:00
Themis Demetriades
f10514f4cc Update priority_more comment description to specify which list_elem member it is compatible with 2024-10-22 18:59:19 +01:00
Themis Demetriades
dae5b0d097 Update semaphore priority scheduling to use linear search on unordered list w/ S 2024-10-20 22:50:31 +01:00
Themis Demetriades
840df8af78 Fix bug in donate_priority that wouldn't update the list of donors w/ S 2024-10-20 22:29:20 +01:00
sBubshait
7f7b1648cd Fix indentation in recalculate priority to match pintos style, w/ T 2024-10-20 22:28:29 +01:00
sBubshait
44de31c0ff Fix Bug in Implementation of recalculate priority setting base priority, w/ T 2024-10-20 20:54:48 +01:00
Themis Demetriades
afcb12cef0 Reformat thread priority changing functions to follow style w/ S 2024-10-20 20:38:28 +01:00
sBubshait
b1dba1a0bd Add implementation for recalculate effective priority, w/ T 2024-10-20 20:37:03 +01:00
Themis Demetriades
8e20884a23 Update releasing of locks to update donation information w/ S 2024-10-20 20:17:27 +01:00
Themis Demetriades
ee0cf632b9 Fix attempt to donate priority within lock acquisition w/ S 2024-10-20 19:45:05 +01:00
sBubshait
343ac55d37 Implement priority donation helper function with propagation, w/ T 2024-10-20 19:42:35 +01:00
Themis Demetriades
f98e4bc81c Update lock_acquire to attempt donation of priorities, w/ S 2024-10-20 19:20:26 +01:00
sBubshait
5a651f1279 Update implementation of thread set priority to account for donations, w/ T 2024-10-20 18:06:07 +01:00
Themis Demetriades
fcc8cbb71e Implement initialization of new threads to track donation information, w/ S 2024-10-20 17:11:44 +01:00
sBubshait
8b1e0b9559 Add donation-related information to the thread structure, w/ T 2024-10-20 17:04:14 +01:00
Themis
6b9b671368 Update sema_up to properly yield during execution of an interrupt handler 2024-10-17 20:01:55 +01:00
sBubshait
bfdedc53e2 Update set priority so not to yield if no ready threads 2024-10-17 19:46:10 +01:00
Themis
711efdc78a Implement priority scheduling for condition variables 2024-10-17 19:43:35 +01:00
sBubshait
c9a9d57019 Merge branch 'task1/priority-scheduling' into task1/merged/priority-scheduling
# Conflicts:
#	.gitignore
#	src/threads/synch.c
#	src/threads/thread.c
2024-10-17 19:30:19 +01:00
sBubshait
88967acdaa Update cond_wait to insert into waiters list in sorted order of priority 2024-10-17 08:53:53 +01:00
sBubshait
e74ee59e17 Update sema priority compare to take aux optionally as priority of first sema 2024-10-17 08:46:14 +01:00
sBubshait
53b296d6c4 Add function to compare the priority of two semaphores 2024-10-17 08:36:29 +01:00
sBubshait
0d6fb2f167 Update sema_up to yield CPU if unblocked has higher priority 2024-10-17 07:15:10 +01:00
sBubshait
24900545d4 Update sema_down to insert into waiters list in priority sorted order 2024-10-17 06:54:10 +01:00
sBubshait
fb268cdef0 Update thread make priority_more public 2024-10-17 06:47:58 +01:00
sBubshait
dbb7fd56e3 Update set priority to reorder the list if priority is changed 2024-10-17 06:38:27 +01:00
sBubshait
949455aae5 Update set priority to eliminate race condition when accessing ready list 2024-10-17 06:35:39 +01:00
sBubshait
5c09ff0149 Updated set priority to yield if priority is lowered 2024-10-17 06:27:59 +01:00
sBubshait
9f53040d27 Update thread_set_priority to not do anything if priority is unchanged 2024-10-17 06:00:34 +01:00
sBubshait
62c8818c05 Update thread_yield to add thread back in sorted order of priority 2024-10-16 08:18:51 +01:00
sBubshait
fda79173c0 Update thread_unblock to maintain priority order in ready_list 2024-10-16 08:14:00 +01:00
sBubshait
1c53790ca7 Update set_priority to ensure that the new priority is within bounds 2024-10-16 08:13:56 +01:00
sBubshait
9bb0b758c8 Fix Error missing semicolon after function signature 2024-10-16 07:40:41 +01:00
sBubshait
8b3f9e353f Update creating thread to yield if the new thread has higher priority 2024-10-16 07:33:24 +01:00