<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: bojack</title>
    <description>The latest articles on DEV Community by bojack (@jesterhead).</description>
    <link>https://dev.to/jesterhead</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4067753%2F03e031f7-1523-4b6f-88f7-b7327fcd2882.png</url>
      <title>DEV Community: bojack</title>
      <link>https://dev.to/jesterhead</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jesterhead"/>
    <language>en</language>
    <item>
      <title>Processes and Threads in Operating Systems</title>
      <dc:creator>bojack</dc:creator>
      <pubDate>Sat, 08 Aug 2026 08:17:14 +0000</pubDate>
      <link>https://dev.to/jesterhead/processes-and-threads-in-operating-systems-21mo</link>
      <guid>https://dev.to/jesterhead/processes-and-threads-in-operating-systems-21mo</guid>
      <description>&lt;h5&gt;
  
  
  Process
&lt;/h5&gt;

&lt;p&gt;In an Operating System, Any program that is currently in execution is called a Process.&lt;/p&gt;

&lt;p&gt;Every process has some unique attributes that allows the OS to control it. These attributes are stored inside a structure called the Process Control Block (PCB).&lt;/p&gt;

&lt;p&gt;Some of the attributes are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Process Id (PID):&lt;/strong&gt; Used to identify a process&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Process State:&lt;/strong&gt; Displays the current state of a process (waiting, running, terminated).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File Descriptors:&lt;/strong&gt; Information about open files and networks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Management Information:&lt;/strong&gt; Details about the allocated memory space to the process and memory structure of the process (stack, heap, etc)&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Thread
&lt;/h5&gt;

&lt;p&gt;A thread is the smallest unit of execution. Many threads work inside a single process to run multiple tasks concurrently.&lt;/p&gt;

&lt;p&gt;Each thread has it's unique register, counter and stack, while all threads inside a process share code, data and operating system resources.&lt;/p&gt;

&lt;p&gt;A single thread process can only accomplish one task at a time. Example- most CLI tools&lt;/p&gt;

&lt;p&gt;A multithread process can accomplish multiple tasks at a time. Example- Browsers (Can display web page and download a file at the same time)&lt;/p&gt;

&lt;p&gt;Benefits of multithreading:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Improves Performance:&lt;/strong&gt; Running different tasks along multiple threads allow for faster execution, better performance and CPU utilization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improves Responsiveness:&lt;/strong&gt; If one thread is busy executing a heavy action, other threads can still process user input or other tasks. This results in responsiveness and better user experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient Resource Sharing:&lt;/strong&gt; Threads share the same memory and resources within a process which makes data sharing and communication faster.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Difference Between Process and Thread:
&lt;/h5&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Process&lt;/th&gt;
&lt;th&gt;Thread&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A program in execution&lt;/td&gt;
&lt;td&gt;A unit of execution inside a process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Independent. Has it's own address space and resources&lt;/td&gt;
&lt;td&gt;Shares the memory space and resources of it's parent process with other threads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Takes more time to create and terminate&lt;/td&gt;
&lt;td&gt;faster to create and terminate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Heavyweight&lt;/td&gt;
&lt;td&gt;Lightweight&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Requires explicit protocol to communicate with other processes&lt;/td&gt;
&lt;td&gt;Can communicate directly with other threads using shared memory&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>computerscience</category>
      <category>software</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
