Operating System Interview

Explain the difference between a process and a thread. Process: Independent execution unit Has its own memory space Heavyweight, more resources Isolated from other processes Thread: Lightweight unit of execution within a process Shares memory space with other threads in the same process Less resource-intensive Can communicate easily with other threads in the same process How do processes and threads communicate Process communication methods: Pipes and named pipes Shared memory Message queues Sockets Signals Thread communication methods: [Read More]

Epoll

epoll (Linux): An Efficient I/O Multiplexing Mechanism epoll operates on an event-driven model, meaning it only notifies the application when an event occurs on a specific file descriptor, unlike select and poll which poll all descriptors regardless of activity. This drastically reduces overhead, especially when managing numerous connections. Key Features and Functionality The core functionality revolves around three system calls: epoll_create(size): Creates an epoll instance and returns an epoll file descriptor. [Read More]