Change types for the thread registers.
Add message passing to tasks.