More work on threads.

Added small demo.