<p>Disclosed in the embodiments of the present invention are a virtual resource allocation method and apparatus, which are applied to the technical field of computers and can avoid switch missing of a user level thread during a process context switch. The method comprises: when the user level thread is suspended, the virtual resource allocation apparatus saving hardware resources corresponding to the user level thread in a control data block of the user level thread; and the virtual resource allocation apparatus saving the hardware resources corresponding to the user level thread in a control data block of a lightweight process corresponding to the user level thread. The embodiments of the present invention are applied to virtual resource allocation.</p>