0% found this document useful (0 votes)
55 views7 pages

Enhancing Hospital Management Systems With Multithreading and Preemptive Scheduling

The document discusses enhancing hospital management systems through multithreading and preemptive scheduling to improve performance and responsiveness. It highlights the benefits of multithreading for concurrent task execution and the role of context switching in managing critical processes. The comparison between preemptive and non-preemptive scheduling emphasizes the advantages of prioritizing urgent tasks while acknowledging the overhead associated with context switching.

Uploaded by

johnnykeig
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views7 pages

Enhancing Hospital Management Systems With Multithreading and Preemptive Scheduling

The document discusses enhancing hospital management systems through multithreading and preemptive scheduling to improve performance and responsiveness. It highlights the benefits of multithreading for concurrent task execution and the role of context switching in managing critical processes. The comparison between preemptive and non-preemptive scheduling emphasizes the advantages of prioritizing urgent tasks while acknowledging the overhead associated with context switching.

Uploaded by

johnnykeig
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

DEPARTMENT OF COMPUTER SCIENCE

UNIVERSITY OF THE PEOPLE

CS2301-01: OPERATING SYSTEMS 1,

WRITTEN ASSIGNMENT, UNIT 2

APRIL 2025
ENHANCING HOSPITAL MANAGEMENT SYSTEMS WITH MULTITHREADING

AND PREEMPTIVE SCHEDULING

Modern hospital management systems manage a wide range of vital functions, including patient

registration, real-time monitoring, medical record retrieval, and invoicing. As these systems

grow in complexity and scale, the limitations of a single-threaded, non-preemptive scheduling

model become more apparent. To overcome performance bottlenecks and increase

responsiveness, combining multithreading alongside preemptive CPU scheduling gives a strong

solution. However, such enhancements must be managed carefully, particularly in terms of

process management and context switching.

IMPACT OF MULTITHREADING AND CONTEXT SWITCHING

Enhancing Performance through Multithreading

Multithreading enables numerous threads to run simultaneously within a single process. In a

hospital administration system, this means that several tasks, such as database queries, patient

form submissions, and contact with external labs, can run concurrently. For example, while one

thread manages a patient's test findings, another can handle the invoicing procedure without

waiting for the first to finish.

Multithreading boosts performance dramatically by increasing CPU use and decreasing idle time.

Threads share the same memory space, according to Arpaci-Dusseau and Arpaci-Dusseau

(2018), which improves communication efficiency. For example, the system's Electronic

Medical Record (EMR) interface can run multiple threads simultaneously, one for retrieving

patient data, one for validating physician inputs, and one for interacting with the pharmacy. This

lowers latency and ensures that critical services are not hampered by background tasks.
ROLE OF CONTEXT SWITCHING

Context switching is the process of saving the state of an active thread and loading the state of

the next thread to run. This step is required to enable multitasking. In a hospital system, context

switching enables the CPU to efficiently manage tasks such as emergency room queue

management, appointment scheduling, and drug inventory updates.

For example, if one thread handling an outpatient appointment becomes stopped while accessing

the database, the system can transfer to another thread handling emergency department check-

ins. According to iFocus Institute (2019), this rapid changeover improves responsiveness while

also maintaining system stability. Though context switching incurs a minor overhead, the trade-

off is beneficial when real-time responsiveness is critical to medical care.

COMPARISON OF SCHEDULING ALGORITHMS

Preemptive vs. Non-Preemptive Scheduling

Non-preemptive scheduling executes processes to completion before switching. While easy to

deploy, it offers major restrictions in a medical context. Example, if a long-running process like

end-of-day reporting starts, it'd delay more important activities like triaging new ER arrivals.

Conversely, preemptive scheduling enables the CPU to interrupt a currently running process to

allow a higher-priority task to execute. This's particularly beneficial in emergencies where time-

Sensitive operations like intensive care monitoring or operating theater coordination must be

prioritized. Preemptive scheduling supports dynamic task prioritization and enhances user

experience by keeping the system responsive.

According to About Technology (2022), preemptive scheduling is better suited for environments
with high variability in task urgency, such as hospitals. However, it also requires efficient

context- switching mechanisms to avoid overhead-related slowdowns.

IMPACT ON RESOURCE ALLOCATION

Preemptive scheduling optimizes resource allocation by ensuring critical tasks receive CPU time

as soon as possible. However, frequent context switches can increase CPU overhead and

resource usage. Non-preemptive scheduling, while reducing context switch overhead, may result

in resource underutilization. A low-priority process can cause bottlenecks for other processes.

Advantages of preemptive scheduling:

a. Improved response to emergencies

b. Improved CPU utilization during mixed workload scenarios

c. Supports prioritization of critical services

Disadvantages:

a. Increased overhead due to frequent context switches

b. More complicated implementation and potential for race conditions

Advantages of non-preemptive scheduling:

a. Simpler design with lesser overhead

b. Less task interruption leads to fewer data inconsistency issues.

Disadvantages:

a. Poor handling of high-priority and time-sensitive tasks


b. Possible underutilization of system resources

CONTEXT SWITCHING PLAN

Managing Multiple Critical Processes

Consider a hospital situation in which the system concurrently handles

a. Emergency room admissions

b. Intensive care unit monitoring

c. Outpatient appointment scheduling

d. Pharmacy prescription processing

Each of these jobs can be allocated a thread, with ICU monitoring and ER admissions taking

precedence. When an emergency admittance request is received, the system uses context

switching to suspend outpatient scheduling.

A thread that manages ER admissions may be preempted to allow ICU monitoring if a critical

patient's vitals drop. Context switching guarantees that these transitions are smooth and that no

process consumes CPU time.

STABILITY AND EFFICIENCY THROUGH CONTEXT SWITCHING

Context switching maintains stability by ensuring all active threads receive CPU time without

starvation. It enables high-priority tasks to be handled quickly, while lower-priority tasks resume

once resources are available. For instance, when a physician enters urgent test results, the thread

receives CPU time immediately, pausing a non-urgent background report. This dynamic

responsiveness is crucial for providing timely care and ensuring system users.
CONCLUSION

Upgrading a hospital's management system to include multithreading and preemptive scheduling

is a strategic decision with long-term benefits. Multithreading enables vital tasks to run

concurrently, boosting performance and resource utilization, while preemptive scheduling

provides for better prioritization of urgent processes. Context switching adds some overhead, but

it is necessary for maintaining system stability and responsiveness. Efficient implementation of

these concepts guarantees that the hospital can provide timely, dependable, and life-saving care

in an increasingly digital healthcare world.


REFERENCES

Arpaci-Dusseau, R. H., & Arpaci-Dusseau, A. C. (2018). Operating systems: three easy pieces

(1.01 ed.). Arpaci-Dusseau Books. https://pages.cs.wisc.edu/~remzi/OSTEP/

Neso Academy. (2019, May 24). Introduction to threads [Video]. YouTube.

https://www.youtube.com/watch?v=Z8axMaBL4HA

Neso Academy. (2018, June 29). Process management (Processes and threads) [Video].

YouTube. https://www.youtube.com/watch?v=KkMDCCdjyW8

iFocus Institute. (2019, September 14). When Context Switch occurs | Context Switching |

Multitasking [Video]. YouTube. https://www.youtube.com/watch?v=dX5GO6jXJwE

About Technology. (2022, March 31). Difference between preemptive and Non-Preemptive

scheduling. https://www.abouttechnology.org/difference-between-preemptive-and-non-

preemptive-scheduling/

You might also like