* Sup Dawgz? - HI! - How are you? * ThreadPool - A constant-size pool of threads continually pulling tasks from a queue and completing them. - Size of thread pool is determined at construction time. - *explicit ThreadPool(uint32_t num_threads);* - Each task is represented by a class aptly named *ThreadPool::Task*. - This is basically just a wrapper around a function of type *thread_task_fn* - *typedef void (*thread_task_fn)(Task *arg);* - *ThreadPool::Task* is meant to be subclassed so that the *thread_task_fn* will have arguments for its computation. - ThreadPool has a simple interface of a single member function: - *void Dispatch(Task *t);* - Add a task to the queue from which the threads consume. - It's the responsibility of the *thread_task_fn* function to free the Task object when it is complete. - i.e. The ThreadPool doesn't manage memory used by *Task* objects. - All *Task* objects are guaranteed to be completed. - On deconstruction, the internal threads will be killed as soon as possible. * Task - http://www.cs.washington.edu/homes/codys/sec8 - Makefile - hacky.cc - ThreadPool.cc - ThreadPool.h - words / words_small - Finish the hacky.cc program so that it will print the word corresponding to the "goal" encryption variable. - Use the ThreadPool to do multiple encryptions in parallel. - Basic Idea: - Encrypt every word in the dictionary. - See if the encryption matches the "goal" string. - If so, you found a matching word. - *Due By The End Of The Day* - *Grade* - 0/3 pts for no attendance - 1/3 pts for only showing up - 2/3 pts for showing up *and* turning in something that: - compiles with no warnings/errors - runs with no valgrind errors - uses the ThreadPool - 3/3 pts for everything above *and* - printing the correct word - using the ThreadPool properly