A fork instruction for execution on a multithreaded microprocessor and
occupying a single instruction issue slot is disclosed. The fork
instruction, executing in a parent thread, includes a first operand
specifying the initial instruction address of a new thread and a second
operand. The microprocessor executes the fork instruction by allocating
context for the new thread, copying the first operand to a program
counter of the new thread context, copying the second operand to a
register of the new thread context, and scheduling the new thread for
execution. If no new thread context is free for allocation, the
microprocessor raises an exception to the fork instruction. The fork
instruction is efficient because it does not copy the parent thread
general purpose registers to the new thread. The second operand is
typically used as a pointer to a data structure in memory containing
initial general purpose register set values for the new thread.