Interview Question

Senior Software Engineer Interview Waterloo, ON (Canada)

Design and implement a thread dispatch pool using a latched

  hardware timer
Tags:
c++, difficult, hardware
Answer

Interview Answer

1 Answer

0

Oddly enough I actually implemented one of these in real life about sixteen years ago. It's very tricky to get correct without race conditions and coping with things like the timer routine deleting itself. Tip: implement an absolute monotonic timer count from the hardware latch first, then write the thread pool using differentials from the absolute count. It also really helps if you know the new atomics support in C11 and C++11 as you can employ acquire/release load/store semantics and atomic increments/decrements.

Interview Candidate on May 4, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.