CITS2002 Systems Programming  
prev
next CITS2002 CITS2002 schedule  

Differences between processes and threads

To date we've seen that a compiled C program becomes a process when passed to the execve() system call. Like our informal definition of threads, a C program also defines a sequence of instructions, local variables, and global variables, so what's the difference?

The primary difference is the degree of independence between processes, and between threads.

  • a standard C program, when executing, is a process with just one thread (often termed single-threaded).

  • however, a thread library enables us to write C programs defining multiple threads within a single process.

Furthermore, these threads are logically independent and thus may be executed concurrently.

 


CITS2002 Systems Programming, Lecture 20, p4, 9th October 2023.