Monitor solution
See the enclosed solution for DP problem using monitors. Can you define a general base class DP that can used to solve any problem that can be modeled as DP? use Posix/Solaris condition variables and mutex for condition and suspension requirements of the monitor.