Add the dual thread code.

Signed-off-by: Rick Taylor <rick@tropicalstormsoftware.com>