@@ -521,6 +521,13 @@ Processes cannot run in true parallelism on a single-core system. On a single-co
Threads within the same process share the same memory space, which is more efficient for communication but requires careful synchronization to avoid race conditions.
Similar to processes, there are operating system-imposed limits on the number of threads per process and the total memory that can be allocated.
In python, no two threads from the same process can run simultaneously (parallelly) because of GIL(Global Interpreter Lock), but they can run concurrently by context switching.
However, if an I/O request is encountered, GIL is released, enabling multiple threads to execute simultaneously.
Threads are handled by the python interpreter while processes are handled by the OS. Threads are concurrent and non-parallel while processes are concurrent and parallel.