Anda di halaman 1dari 2

Officially: "Mutexes are typically used to serialise access to a section of re-

entrant code that cannot be executed concurrently by more than one thread. A
mutex object only allows one thread into a controlled section, forcing other
threads which attempt to gain access to that section to wait until the first thread
has exited from that section."

Officially: "A semaphore restricts the number of simultaneous users of a shared
resource up to a maximum number. Threads can request access to the resource
(decrementing the semaphore), and can signal that they have finished using the
resource (incrementing the semaphore)."

nterprocess communication (IPC) is a set of programming interfaces that allow a programmer to coordinate activities
among different program processes that can run concurrently in an operating system.

Threads differ from traditional multitasking operating system processes in that:
processes are typically independent, while threads exist as subsets of a process
processes carry considerably more state information than threads, whereas multiple threads within a process share
process state as well as memory and other resources
processes have separate address spaces, whereas threads share their address space
processes interact only through system-provided inter-process communication mechanisms
context switching between threads in the same process is typically faster than context switching between processes.


Queue ex:
Luggage checking machine: Luggage checking machine checks the luggage first that comes first. Therefore, it follows FIFO
principle of queue. 5. Patients waiting outside the doctor's clinic: The patient who comes first visits the doctor first, and the
patient who comes last visits the doctor last.

Stack ex:
When a person wear bangles the last bangle worn is the first one to be removed and the first bangle would be the last to be
removed. This follows last in first out (LIFO)
Cars in a garage :- In order to take out the car that was parked first you need to take out the car that was parked last. So the
car that was parked first would be the last to take out

Switch statement looks a lot more tidy and easy to read and understand. 2.Here multiple statements need not to be enclosed
within a pair of braces.3.Switch statement executes faster than if_else because the switch statement checks the condition first
and then jumps to the suitable case statement.

Dynamic IP addresses
Dynamic IP addresses are acquired from a DHCP server, and they may change from time to time. You can provide dynamic IP addresses
to the computers on your network by configuring one or more DHCP servers. The DHCP server must be assigned a static IP address.
Static IP addresses
A static IP address does not change. It is assigned by the network administrator, and it is manually entered into the properties for the
network adapter that is on a server or on a client computer. A static IP address does not require that a DHCP server is running on the
network.

Anda mungkin juga menyukai