Difficulty |
2 |
Reading material |
This extension will have you create a task scheduler that runs tasks in parallel. More specifically, you want to create exactly one thread per task.
Important
|
This is actually a very bad approach to multithreading, since threads are slow to create and require relatively many resources (a stack, constant context switching). Creating as many threads as there are tasks (i.e., probably hundreds) is rather foolish since your machine very probably has much fewer cores. A good rule of thumb is not to create more threads than you have cores. Other schedulers will use a more sensible approach. |
Create files
Use the provided serial scheduler’s implementation as a guide.
|
Find out how to make your ray tracer use your new scheduler.
|
Debugging multithreaded code is no fun. Make it so that debug build always uses the serial task scheduler whereas release build will use your newly made parallel scheduler. |
1. Evaluation
Show the code that lets the ray tracer use the serial/parallel scheduler in debug/release build, respectively. |
How many (logical) cores does your machine have? By what factor have rendering times been lowered? |