Quiz 1

We'll cover the following...

Question # 1

What are some of the differences between a process and a thread?

  • A process can have many threads, whereas a thread can belong to only one process.

  • A thread is lightweight than a process and uses less resources than a process.

  • A thread has some state private to itself but threads of a process can share the resources allocated to the process including memory address space.

Question # 2

Given the below code, can you identify what the coder missed?

    void defectiveCode(final int n) throws ExecutionException, InterruptedException {

       
...