Midterm Lecture 3 Flashcards
cooperating processes: why this framework would be useful
Cooperating processes can be designed to perform specific tasks or components of a larger system. This modular approach makes it easier to organize and manage complex systems, as each process can focus on its unique functionality. This is especially valuable in large-scale software development.
“Open before use”
“Open before use” is a common principle in the context of input and output (I/O) operations in computer programming, particularly when working with files. This principle means that, before attempting to read from or write to a file or any I/O resource, you should explicitly open the resource using appropriate functions or methods provided by the operating system or programming language. Here’s why the “open before use” principle is useful:
I/O
Opening a file or I/O resource allocates necessary system resources, establishes a connection, and performs any necessary setup. This is essential for tracking the status of the resource and avoiding resource leaks.
producer/consumer model for communication
One process “producer” writes to a shared buffer, while the other, “consumer” reads the data from the shared buffer.
Blocking vs Nonblocking
Blocking: The process is halted until the reader reads it.
Nonblocking: The process continues whether the reader retrieves the data or not.