Initial version of thread creation functionality.