CST 334 Week 5
This week I learned about threads in a process, a thread is like a process but all runs from the same base process. These threads allow for concurrency within a process to improve efficiency and performance. Threads behave like other processes in this sense as when one thread waits for I/O the CPU can jump to another thread so the system is not completely on hold. These threads often access the same data and files which is not common with concurrent processes. This unique quirk with threads means that special precautions need to be taken to ensure that integrity is upheld within the process. Locks are the best way to do this as they ensure that when one thread is accessing or updating data or files. By locking a thread it means that no other thread can hold that lock which prevent said thread from continuing. There are multiple kinds of locks that can be implemented depending on the type of program you are developing. Threads are an essential part of operating systems .