Module 3a - Processes Flashcards
What does “ps” command in linux do?
Lists running processes
<p></p>
<p>What does the "top" command do in linux?</p>
<p></p>
<p>Displays processes with top resource usage</p>
<p></p>
<p>What does the "kill" / "pkill" / "killall" command do in linux?</p>
<p></p>
<p>terminates a process</p>
<p></p>
<p>What does "jobs" do in linux?</p>
<p></p>
<p>Lists currently running jobs</p>
<p></p>
<p>What does "bg" do in linux?</p>
<p></p>
<p>Backgrounds a job</p>
<p></p>
<p>What does "fg" do in linux?</p>
<p></p>
<p>Foregrounds a job</p>
<p></p>
<p>What does "nice" / "renice" do in linux?</p>
<p></p>
<p>Sets the priority of a process</p>
<p></p>
<p>What makes IPC (inter-process communication) using a named pipe in linux/unix costly?</p>
<p></p>
<p>IPC with a pipe requires the operating system to make a context switch from user space to kernel space, and then back from kernel space to user space</p>
<p></p>
<p>How do threads running in the same process typically communicate?</p>
<p></p>
<p>Directly through shared memory</p>
If an OS kernel supports multithreading through lightweight processes, what does this mean in terms of address spaces?
Lightweight processes will share the same address space, just like threads
<p></p>
<p>Describe how a multi-threaded server which follows the dispatcher/worker design</p>
<p></p>
<p>The dispatcher thread (which does mostly I/O work) receives requests from the network, and feeds them to a pool or worker threads (which do CPU intensive tasks)</p>
Applications caninteract with the hardware’s resources through several ways:
- Directly from the application
- Through a library that interacts with the OS which interacts with the hardware
How exactly dothese interactionswork? Are they the same privilege?
- An application’s general instructions are always processed by the CPU (direct unprivilegedinteraction)
- An application can makea call to a library function, or make a system call to the OS
- A library can make a system call to the OS
- OS can execute privileged instructions that the application cannot
When the OS accesses the hardware, it is privileged (kernel). When the application does it directly, it is unprivileged)
What is “virtualization” when running applications?
Applications often run in a virtualized environment such as JRE or JVM. This isolates the applications from the underlying hardware platform (and sometimes the OS)
<p>What are benefits of "virtualization"?</p>
- improves safety since the application won’t be able to access the files, and privileged resources
- makes the application more replicable
- easier to maintain
How do networked applications communicate?
How is the format of a message (Binary vs JSON vs text, etc) determined?
- They communicate by exchanging messages through additional infrastructure such as middleware
- Message passing protocol determines the format of the message (binary vs JSON, vs text, etc)