Hasty Briefsbeta

Processes and Threads

19 hours ago
  • #Operating Systems
  • #Multitasking
  • #CPU
  • Processes are fundamental abstractions provided by operating systems for executing software.
  • CPU and RAM work together to execute code and manipulate data.
  • Instruction sets define the operations a CPU can perform, with x86-64 and ARM64 being common examples.
  • Computers can run multiple programs simultaneously through CPU multitasking via processes.
  • Context switching allows CPUs to switch between processes, enabling multitasking.
  • Process states include running, ready, waiting, and killed, managed by the operating system.
  • New processes are created using system calls like fork() and execve().
  • Threads offer a lighter-weight alternative to processes for multitasking within a single process.
  • MySQL uses thread-per-connection, while Postgres uses process-per-connection, affecting performance.
  • Connection pooling helps manage database connections efficiently by funneling multiple client connections into a smaller pool of database connections.