python threading vs multiprocessing

The Python threading module uses threads instead of processes.
Threads uniquely run in the same unique memory heap.
Whereas Processes run in separate memory heaps.
This makes sharing information harder with processes and object instances.
One problem arises because threads use the same memory heap,
multiple threads can write to the same location in the memory heap
which is why the global interpreter lock(GIL) in CPython was created
as a mutex to prevent it from happening.

Here is what the above code is Doing:
1. It’s creating a new thread.
2. It’s telling the new thread to run the function “thread_function”
3. It’s starting the new thread.
4. It’s waiting for the new thread to finish.
5. It’s printing out the result of the new thread.

The output of the above code will be:

Thread finished with result: 42