Process management in Ruby

Ruby

Published on by

Mathieu EUSTACHY

Mathieu EUSTACHY

7 minutes reading

You probably already heard this word "process". But do you know exactly what is a process in your operating system? How it's different from an application? What are the stack and the heap?


Application, process, heap, stack, wow that's a lot of triggering words. Ever wondered what they are and how they are translated in the Ruby world? ๐Ÿ’Ž


Letโ€™s dive into it!


This article is the 2nd article of a broader series about โ€œlow-levelโ€ computing concepts applied to Ruby.

  1. What is a Ruby implementation?
  2. Process management in Ruby
  3. Concurrency and parallelism in Ruby
  4. Thread management in Ruby
  5. Memory management in Ruby


Always keep in mind that I am intentionally summarising things to give you a quick overview, there is more to each concept.



Application vs Process


Let's start with two fondamental definitions:

  • Application: A file containing a list of instructions stored on the disk (= an executable)
  • Process: An instance of an executing application


To put it simply, when launched, the application is loaded into the memory and it becomes a process. You can launch several processes of the same application, like when you have several Google Chrome browsers opened, or, in a more prosaic way, you running web server might use several processes, each being an instance of your web application (but more on that in the next article about concurrency and parallelism).