[go: up one dir, main page]

HK1237090B - Method and system for executing multi threads on computer processor core - Google Patents

Method and system for executing multi threads on computer processor core Download PDF

Info

Publication number
HK1237090B
HK1237090B HK17111100.5A HK17111100A HK1237090B HK 1237090 B HK1237090 B HK 1237090B HK 17111100 A HK17111100 A HK 17111100A HK 1237090 B HK1237090 B HK 1237090B
Authority
HK
Hong Kong
Prior art keywords
thread
threads
exit
grace period
execution
Prior art date
Application number
HK17111100.5A
Other languages
Chinese (zh)
Other versions
HK1237090A1 (en
Inventor
L.海勒
F.Y.布萨巴
J.D.布拉德伯里
M.法雷尔
D.格雷纳
J.P.库巴拉
D.L.奥西塞克
T.什莱格尔
D.W.施密特
C.小盖尼
Original Assignee
国际商业机器公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 国际商业机器公司 filed Critical 国际商业机器公司
Publication of HK1237090A1 publication Critical patent/HK1237090A1/en
Publication of HK1237090B publication Critical patent/HK1237090B/en

Links

Description

在计算机处理器核心上执行多个线程的方法和系统Method and system for executing multiple threads on a computer processor core

背景技术Background Art

本发明一般地涉及多线程处理器的协调式开始解释执行退出,更具体地说,涉及在多线程环境中结合协调式开始解释执行退出来提供等待状态及警告跟踪以降低多线程环境中的资源成本。The present invention generally relates to coordinated start of interpreted execution exit for multithreaded processors, and more particularly to providing wait state and warning tracking in conjunction with coordinated start of interpreted execution exit in a multithreaded environment to reduce resource costs in the multithreaded environment.

一般而言,多线程增加了能够在单个处理器核心内并行操作的处理器线程数。多线程通过使一个或多个处理器线程使用单个处理器核心的硬件的多个部分(这些部分当前未被在该单个处理器核心上运行的一个或多个其他处理器线程使用)来提供这种增加的容量。例如,在由第一处理器线程中的高速缓存未命中或其他延迟导致的延时期间,一个或多个其他处理器线程能够利用在高速缓存未命中期间分派给第一处理器线程的核心资源,从而提高这些核心资源的利用率。Generally speaking, multithreading increases the number of processor threads that can operate in parallel within a single processor core. Multithreading provides this increased capacity by enabling one or more processor threads to use portions of the hardware of a single processor core that are not currently being used by one or more other processor threads running on the single processor core. For example, during a delay caused by a cache miss or other delay in a first processor thread, one or more other processor threads can utilize core resources that were assigned to the first processor thread during the cache miss, thereby improving utilization of those core resources.

虽然多线程提供了硬件节省,但与使用额外的单独处理器核心提供增加的容量相比,添加另一线程在软件级别消耗更多的协调成本。在许多情况下,在实现某一缩放比之后,在线程(无论是在单个还是共享处理器核上运行)之间协调核心资源的开销相当大,并且会降低或者甚至超过独立处理器线程的益处。While multithreading provides hardware savings, adding another thread incurs more coordination costs at the software level than using an additional individual processor core to provide increased capacity. In many cases, after achieving a certain scaling ratio, the overhead of coordinating core resources between threads (whether running on a single or shared processor core) is significant and can reduce or even outweigh the benefits of independent processor threads.

发明内容Summary of the Invention

根据本发明的一个实施例,提供一种在计算机处理器核心上执行多个线程的方法,所述多个线程包括第一线程和一组剩余线程,所述方法包括:确定存在开始解释执行退出条件;确定所述计算机处理器核心在宽限期内;所述第一线程进入开始解释执行退出同步循环而不用信号通知所述一组剩余线程中的任一者;以及所述第一线程保持处于所述开始解释执行退出同步循环,直至所述宽限期到期或者所述剩余线程中的每一者进入对应的开始解释执行退出同步循环。According to one embodiment of the present invention, a method for executing multiple threads on a computer processor core is provided, the multiple threads including a first thread and a group of remaining threads, the method comprising: determining that a start interpret execute exit condition exists; determining that the computer processor core is within a grace period; the first thread entering a start interpret execute exit synchronization loop without signaling any of the group of remaining threads; and the first thread remaining in the start interpret execute exit synchronization loop until the grace period expires or each of the remaining threads enters a corresponding start interpret execute exit synchronization loop.

经由本发明的技术实现额外特征及优点。本发明的其他实施例及方面在本文中经详细描述并且被视为所要求保护的发明的一部分。为更好地理解具有这些优点及特征的本发明,参考描述及附图。Additional features and advantages are achieved through the techniques of the present invention. Other embodiments and aspects of the present invention are described in detail herein and are considered a part of the claimed invention. For a better understanding of the present invention with these advantages and features, reference is made to the description and drawings.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

在本说明书的结尾部分处的权利要求书中特别指出并且清楚地要求保护被视为本发明的主题。本发明的前述内容及其他特征以及优势自结合附图进行的以下详细描述显而易见,其中:The subject matter which is regarded as the invention is particularly pointed out and distinctly claimed in the claims at the conclusion of this specification. The foregoing and other features and advantages of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:

图1示出多线程系统的计算设备示意图;FIG1 is a schematic diagram showing a computing device of a multi-threaded system;

图2示出多线程系统的处理器示意图;FIG2 shows a schematic diagram of a processor of a multi-threaded system;

图3A-3B示出多线程系统的关于等待状态的处理流程;3A-3B illustrate a processing flow regarding a wait state in a multi-threaded system;

图4A-4B示出多线程系统的关于核心分派环境中的等待状态的另一处理流程;4A-4B illustrate another processing flow of a multi-threaded system regarding a wait state in a core dispatch environment;

图5示出多线程系统的关于核心分派环境中的警告跟踪的处理流程;以及FIG5 shows a process flow of warning tracking in a core dispatching environment of a multi-threaded system; and

图6A-6C示出多线程系统的关于核心分派环境中的警告跟踪的另一处理流程。6A-6C illustrate another process flow for warning tracking in a core dispatch environment of a multi-threaded system.

具体实施方式DETAILED DESCRIPTION

如上所指出,处理器线程之间的多线程中的协调成本相当大,并且会降低或者甚至超过独立处理器线程的益处。因此,需要这样的多线程环境:其结合协调式开始解释执行退出来提供等待状态及警告跟踪以降低多线程环境中的资源成本。As noted above, the coordination cost in multithreading between processor threads is substantial and can reduce or even outweigh the benefits of independent processor threads. Therefore, a need exists for a multithreaded environment that provides wait states and warning tracking in conjunction with coordinated start-interpret-execute-exit to reduce resource costs in a multithreaded environment.

一般而言,本文揭示的本发明的实施例可包括一种多线程系统、方法和/或计算机程序产品,其利用软件在粒度线程基础上有效地管理核心上的基础架构以降低核心的资源成本。这通过以下操作实现:允许在单个线程上运行的系统管理程序使用核心分派在单个核心上分派多个客机线程(guest thread),以及结合协调式开始解释执行退出来利用等待状态及警告跟踪。Generally speaking, embodiments of the invention disclosed herein may include a multithreaded system, method, and/or computer program product that utilizes software to efficiently manage infrastructure on a core at a granular thread basis to reduce core resource costs. This is achieved by allowing a hypervisor running on a single thread to dispatch multiple guest threads on a single core using core dispatching, and utilizing wait states and warning tracking in conjunction with coordinated start of interpret execution exit.

现在将描述由所述多线程系统、方法和/或计算机程序(“多线程系统”)通过协调式开始解释执行(“SIE”)退出的核心分派。亦即,经由核心分派,多线程系统允许单线程运行的系统管理程序使用单个指令在其核心上分派多线程客机(注意,每个多线程客机表示一个客机逻辑处理器或客机线程)。单个指令的操作数可指定包含所有客机线程的状态的单个状态描述,或者一组状态描述,例如每个状态描述表示单个客机线程的状态。另外,为了支持核心分派的使用并且考虑到单线程运行的系统管理程序,由所述多线程系统提供协调式SIE退出以使所有客机线程能够同时退出。The multi-threaded system, method, and/or computer program ("multi-threaded system") will now be described as utilizing core dispatching via coordinated start of interpreted execution ("SIE") exit. That is, via core dispatching, the multi-threaded system allows a single-threaded hypervisor to dispatch multi-threaded guests onto its cores using a single instruction (note that each multi-threaded guest represents a guest logical processor or guest thread). The operands of the single instruction may specify a single state description encompassing the states of all guest threads, or a set of state descriptions, e.g., each state description representing the state of a single guest thread. Furthermore, to support the use of core dispatching and to accommodate single-threaded hypervisors, the multi-threaded system provides coordinated SIE exits to enable all guest threads to exit simultaneously.

例如,当客机核心的每个线程确定其必须退出解释执行模式时,它进入SIE退出状态,并且在初始SIE退出同步循环中等待,直至同一核心的所有其他有效线程也准备好退出。在某些情况下,在进入该同步循环之前每个线程用信号通知其他线程退出。For example, when each thread of a guest core determines that it must exit interpreted execution mode, it enters the SIE Exit state and waits in an initial SIE Exit synchronization loop until all other active threads of the same core are also ready to exit. In some cases, each thread signals the other threads to exit before entering this synchronization loop.

现在将描述多线程系统的非多线程和/或多线程环境中的等待状态。关于非多线程环境,当客机线程已完成来自队列的任务并且队列上没有额外任务时,多线程系统将等待状态代码或位加载至程序状态字(“PSW”)中。PSW中的等待状态位导致客机线程暂停指令执行,直至提供中断。当客机线程在专用非多线程环境中运行(例如,物理处理器专门由单个客机线程使用),并且单个客机线程进入已启用的(亦即,针对异步中断启用客机)等待状态时,单个客机线程将保持在物理处理器上分派,直至识别到中断。如果客机线程在共享环境中运行(亦即,物理处理器被在不同客机逻辑处理器之间共享),则当客机线程进入等待状态时,共享环境将通过等待状态拦截退出解释执行,因此系统管理程序能够(如果适用)分派具有要执行的工作的不同客机线程。Wait states in a non-multithreaded and/or multithreaded environment of a multithreaded system will now be described. With respect to a non-multithreaded environment, when a guest thread has completed a task from a queue and there are no additional tasks on the queue, the multithreaded system loads a wait state code or bit into the program status word ("PSW"). The wait state bit in the PSW causes the guest thread to pause instruction execution until an interrupt is provided. When a guest thread is running in a dedicated non-multithreaded environment (e.g., a physical processor is used exclusively by a single guest thread), and the single guest thread enters an enabled (i.e., guest-enabled for asynchronous interrupts) wait state, the single guest thread will remain dispatched on the physical processor until an interrupt is recognized. If the guest thread is running in a shared environment (i.e., a physical processor is shared between different guest logical processors), when the guest thread enters a wait state, the shared environment will exit interpreted execution via a wait state interception, allowing the hypervisor to, if applicable, dispatch a different guest thread with work to perform.

关于多线程环境,如果核心上的客机线程仍然正在执行客机指令,则对于核心而言更有效的是继续运行,直至核心上的所有有效线程已进入等待状态或者由于另一原因需要协调式SIE退出。另外,处于已启用的等待状态的线程进入固件等待状态循环;以及如果在所有其他线程已进入等待状态之前向该线程呈现中断,则该线程可处理中断并且退出固件等待状态循环(例如,中断包括另一线程对协调式SIE退出的任何请求)。In a multi-threaded environment, if a guest thread on a core is still executing guest instructions, it is more efficient for the core to continue running until all active threads on the core have entered a wait state or a coordinated SIE exit is required for another reason. In addition, a thread in an enabled wait state enters a firmware wait state loop; and if an interrupt is presented to the thread before all other threads have entered a wait state, the thread can process the interrupt and exit the firmware wait state loop (e.g., the interrupt includes any request for a coordinated SIE exit by another thread).

现参考图1,展示包括计算设备112的多线程系统100的一个实例。多线程系统100仅为合适的计算节点的一个实例且并不意欲表示对本文所述的本发明的实施例的使用或可操作性的范围的任何限制(实际上可使用额外或替代的组件和/或实施方式)。亦即,多线程系统100及其中的组件可采用多个不同形式且包括多个和/或替代组件及设施。另外,如本文所描述,多线程系统100可包括和/或采用任何数目和组合的计算设备及利用各种通信技术的网络。无论如何,多线程系统100能够被实施和/或执行本文所阐述的任何可操作性。Referring now to FIG. 1 , an example of a multi-threaded system 100 including a computing device 112 is shown. The multi-threaded system 100 is merely an example of a suitable computing node and is not intended to represent any limitation on the scope of use or operability of the embodiments of the present invention described herein (indeed, additional or alternative components and/or implementations may be used). That is, the multi-threaded system 100 and the components therein may take a variety of different forms and include multiple and/or alternative components and facilities. In addition, as described herein, the multi-threaded system 100 may include and/or employ any number and combination of computing devices and networks utilizing various communication technologies. Regardless, the multi-threaded system 100 is capable of being implemented and/or performing any operability described herein.

在多线程系统100中,存在计算设备112,所述计算设备与大量其他通用或专用计算系统环境或配置一起操作。系统和/或计算设备(诸如多线程系统100和/或计算设备112)可采用多个计算机操作系统中的任一者,包括(但不限于)由纽约阿蒙克的国际商业机器公司发行的AIX UNIX及z/OS操作系统的版本和/或种类、微软Windows操作系统、Unix操作系统(例如,由加利福尼亚红木海岸的甲骨文公司发行的Solaris操作系统)、Linux操作系统、由加利福尼亚库珀蒂诺的Apple公司发行的Mac OS X及iOS操作系统、由加拿大滑铁卢的动态研究公司发行的黑莓OS及由开放手机联盟开发的Android操作系统。可适用于与计算设备112一起使用的计算系统、环境和/或配置的实例包括(但不限于)个人计算机系统、服务器计算机系统、瘦客户端、复杂型客户端、手持设备或膝上计算机设备、多处理器系统、基于微处理器的系统、机顶盒、可编程消费电子设备、网络PC、小型计算机系统、计算机工作站、服务器、桌面计算机、笔记本电脑、网络设备、大型计算机系统,及包括以上系统或设备中任一者的分布式云端计算环境及其类似物。In the multi-threaded system 100, there is a computing device 112 that operates with a variety of other general-purpose or special-purpose computing system environments or configurations. Systems and/or computing devices, such as the multi-threaded system 100 and/or computing device 112, can employ any of a number of computer operating systems, including, but not limited to, versions and/or flavors of the AIX UNIX and z/OS operating systems distributed by International Business Machines Corporation of Armonk, New York, the Microsoft Windows operating system, Unix operating systems (e.g., the Solaris operating system distributed by Oracle Corporation of Redwood Shores, California), the Linux operating system, Mac OS X and iOS operating systems distributed by Apple Inc. of Cupertino, California, the BlackBerry OS distributed by Dynamic Research Corporation of Waterloo, Canada, and the Android operating system developed by the Open Handset Alliance. Examples of computing systems, environments, and/or configurations suitable for use with computing device 112 include, but are not limited to, personal computer systems, server computer systems, thin clients, complex clients, handheld or laptop computer devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputer systems, computer workstations, servers, desktop computers, laptop computers, network appliances, mainframe computer systems, and distributed cloud computing environments that include any of the above systems or devices, and the like.

可在由计算机系统执行的诸如程序模块的计算机系统可执行指令的总体上下文中描述计算设备112。通常,程序模块可包括执行特定任务或实施特定抽象数据类型的例程、程序、对象、组件、逻辑、数据结构等。计算设备112可在分布式云端计算环境中实现,在所述环境中,任务由经由通信网路链接的远程处理设备执行。在分布式云端计算环境中,程序模块可位于包括存储设备的本地及远程计算机系统存储介质两者中。The computing device 112 can be described in the general context of computer system-executable instructions, such as program modules, executed by a computer system. Generally, program modules can include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computing device 112 can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules can be located in both local and remote computer system storage media, including storage devices.

如图1中所示,多线程系统100中的计算设备112以基于多线程系统100、其方法和/或其组件的操作及功能改进的通用计算设备的形式展示。计算设备112的组件可包括(但不限于)一个或多个处理器或处理单元(例如,包括支持多个线程115的至少一个核心114a的处理器114;例如多线程系统100包括包含两个或两个以上线程115的处理器114的核心114a)、存储器116、以及耦接包括处理器114及存储器116的各种系统组件的总线118。计算设备112通常亦包括多种计算机系统可读介质。此类介质可为可由计算设备112存取的任何可用介质,并且其包括易失性及非易失性介质、可移除式及不可移除式介质两者。As shown in FIG1 , the computing device 112 in the multi-threaded system 100 is shown in the form of a general-purpose computing device that is improved based on the operation and functionality of the multi-threaded system 100, its methods, and/or its components. Components of the computing device 112 may include, but are not limited to, one or more processors or processing units (e.g., a processor 114 including at least one core 114a that supports multiple threads 115; for example, the multi-threaded system 100 includes a core 114a of the processor 114 that includes two or more threads 115), memory 116, and a bus 118 that couples various system components including the processor 114 and the memory 116. The computing device 112 also typically includes a variety of computer system-readable media. Such media can be any available media that can be accessed by the computing device 112, and includes both volatile and non-volatile media, and both removable and non-removable media.

处理器114可接收来自存储器116的计算机可读程序指令且执行这些指令,由此执行由多线程系统100定义的一个或多个处理。处理器114可包括任何处理硬件、软件或由计算设备114利用的硬件及软件的组合,计算设备114通过执行算术、逻辑和/或输入/输出操作来执行计算机可读程序指令。处理器114及核心114a的实例包括(但不限于):算术逻辑单元,其执行算术及逻辑运算;控制单元,其提取、解码及执行来自存储器的指令;以及阵列单元,其利用多个并行计算元件。The processor 114 may receive computer-readable program instructions from the memory 116 and execute these instructions, thereby performing one or more processes defined by the multi-threaded system 100. The processor 114 may include any processing hardware, software, or a combination of hardware and software utilized by the computing device 114 to execute computer-readable program instructions by performing arithmetic, logical, and/or input/output operations. Examples of the processor 114 and core 114a include, but are not limited to: an arithmetic logic unit that performs arithmetic and logical operations; a control unit that fetches, decodes, and executes instructions from memory; and an array unit that utilizes multiple parallel computing elements.

图2示出包括耦接至控制器215的处理器114的计算环境的一个实施例。在一个实例中,基于z/Architecture的计算环境包括System z服务器,所述服务器由纽约阿蒙克的国际商业机器公司提供。举例而言,处理器114可包括一个或多个分区(例如,逻辑分区LP1至逻辑分区LPn)、一个或多个物理核心(例如,核心1至核心m)及0级系统管理程序214(例如,逻辑分区管理器)。控制器215可包括负责在发布请求的不同处理器之间仲裁的集中式逻辑。举例而言,当控制器215接收存储器存取请求时,其判定是否允许存取该存储器位置,且如果允许,则将该存储器位置的内容提供至处理器114,同时维持该复合体内的处理器之间的存储器一致性。另一控制器215可管理至/自图1中所示的I/O接口130和/或网络适配器132的请求。FIG2 illustrates one embodiment of a computing environment including a processor 114 coupled to a controller 215. In one example, the computing environment based on the z/Architecture includes a System z server provided by International Business Machines Corporation of Armonk, New York. For example, the processor 114 may include one or more partitions (e.g., logical partitions LP1 through LPn), one or more physical cores (e.g., core 1 through core m), and a level-0 hypervisor 214 (e.g., a logical partition manager). The controller 215 may include centralized logic responsible for arbitrating between different processors issuing requests. For example, when the controller 215 receives a memory access request, it determines whether access to the memory location is permitted and, if so, provides the contents of the memory location to the processor 114 while maintaining memory coherency between processors within the complex. Another controller 215 may manage requests to and from the I/O interface 130 and/or network adapter 132 shown in FIG1 .

物理核心包括分配至逻辑分区的物理处理器资源。逻辑分区可包括一个或多个逻辑处理器,其中的每一者表示分配至该分区的所有或一部分物理处理器资源。物理核心可专用于特定分区的逻辑核心,使得基础核心的物理处理器资源被保留用于该分区;或与另一分区的逻辑核心共享,使得基础核心资源的物理处理器资源潜在地可用于另一分区。每个逻辑分区能够充当单独系统。亦即,每个逻辑分区可独立地被重设,初始被加载操作系统(例如,操作系统OS1至操作系统OSn)(如果需要),并且使用不同程序操作。在逻辑分区中运行的操作系统或应用程序似乎可存取整个完整的系统,但实际上,仅该整个系统的一部分可供使用。硬件及授权内部代码(亦被称作固件、微码或毫码)的组合阻止一个逻辑分区中的程序观察、存取或干扰不同逻辑分区中的程序。这允许若干不同逻辑分区以时间分片方式在单个或多个物理核心上操作。在一个实施例中,每个物理核心包括一个或多个中央处理器(在本文中亦被称作“物理线程”)。在图2中所示的实例中,每个逻辑分区具有常驻操作系统,所述操作系统可针对一个或多个逻辑分区而不同。每个逻辑分区是操作系统能够在其中运行的虚拟机或客机配置的一个实例。A physical core comprises physical processor resources allocated to a logical partition. A logical partition may include one or more logical processors, each of which represents all or a portion of the physical processor resources allocated to that partition. A physical core can be dedicated to a logical core of a particular partition, so that the physical processor resources of the underlying core are reserved for that partition; or it can be shared with a logical core of another partition, so that the physical processor resources of the underlying core are potentially available to the other partition. Each logical partition is capable of functioning as a separate system. That is, each logical partition can be independently reset, initially loaded with an operating system (e.g., operating system OS1 through operating system OSn) (if necessary), and operated using different programs. An operating system or application running in a logical partition appears to have access to the entire complete system, but in reality, only a portion of the entire system is available. A combination of hardware and authorized internal code (also known as firmware, microcode, or millicode) prevents programs in one logical partition from observing, accessing, or interfering with programs in a different logical partition. This allows several different logical partitions to operate on a single or multiple physical cores in a time-sliced manner. In one embodiment, each physical core includes one or more central processing units (also referred to herein as "physical threads"). 2, each logical partition has a resident operating system, which may be different for one or more logical partitions. Each logical partition is an instance of a virtual machine or guest configuration in which an operating system can run.

在图2中所示的实施例中,逻辑分区LP1至逻辑分区LPn由0级系统管理程序214管理,所述系统管理程序由在物理核心1至物理核心m上运行的固件实施。逻辑分区LP1至逻辑分区LPn及系统管理程序214各自包括驻留于与物理核心1至物理核心m相关联的中央存储装置(存储器)的相应部分中的一个或多个程序。系统管理程序214的一个实例为由纽约阿蒙克的国际商业机器公司提供的Processor Resource/Systems Manager(PR/SMTM)。In the embodiment shown in FIG2 , logical partitions LP1 through LPn are managed by a level-0 hypervisor 214 implemented by firmware running on physical cores 1 through m. Logical partitions LP1 through LPn and hypervisor 214 each comprise one or more programs residing in respective portions of central storage (memory) associated with physical cores 1 through m. One example of hypervisor 214 is Processor Resource/Systems Manager (PR/SM ), available from International Business Machines Corporation in Armonk, New York.

返回到图1,存储器116可包括有形设备,所述有形设备保留及存储计算机可读程序指令(如由多线程系统100提供)以由计算设备112的处理器114使用。存储器116可包括呈易失性存储器形式的计算机系统可读介质,诸如随机存取存储器(RAM)120、高速缓存122和/或存储系统124。总线118表示若干类型的总线结构中的任一种中的一者或多者,包括存储器总线或存储器控制器、外围总线、加速图形端口及使用各种总线架构中的任一者的处理器或本地总线。通过实例且不加以限制,此类架构包括工业标准体系结构(ISA)总线、微通道体系结构(MCA)总线、增强型ISA(EISA)总线、视频电子标准协会(VESA)本地总线及外围组件互连(PCI)总线。Returning to FIG1 , memory 116 may comprise a tangible device that retains and stores computer-readable program instructions (as provided by multi-threaded system 100) for use by processor 114 of computing device 112. Memory 116 may comprise computer system-readable media in the form of volatile memory, such as random access memory (RAM) 120, cache 122, and/or storage system 124. Bus 118 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example and not limitation, such architectures include an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

仅藉助于实例,可提供存储系统124以用于自不可移除式非易失性磁性介质(图中未展示且通常称为“硬盘驱动器”)读取且写入至所述磁性介质。虽然未展示,但是可提供用于自可移除式非易失性磁盘(例如,“软盘”)读取且写入至所述磁盘的磁盘驱动器,及用于自可移除式非易失性光盘(诸如CD-ROM、DVD-ROM或其他光学介质)读取或写入至所述光盘的光盘驱动器。在此类情况下,每个驱动器可由一个或多个数据介质接口连接至总线118。如下文将进一步描绘及描述,存储器116可包括具有被配置为执行本发明的实施例的操作的程序模块集合(例如,至少一个集合)的至少一个程序产品。存储系统124(和/或存储器116)可包括数据库、数据存储库或其他数据存储器且可包括用于存储、存取及取回各种类型的数据的各种类型的机构,包括分层数据库、文件系统中的文件集合、专有格式的应用数据库、关系数据库管理系统(RDBMS)等。存储系统124大体上可包括在计算设备112内(如所示出,所述计算设备采用诸如上述操作系统中的一者的计算机操作系统)且以多种方式中的任何一种或多种方式经由网络进行存取。By way of example only, a storage system 124 may be provided for reading from and writing to a non-removable, non-volatile magnetic medium (not shown and typically referred to as a "hard drive"). Although not shown, a magnetic disk drive may be provided for reading from and writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive may be provided for reading from or writing to a removable, non-volatile optical disk (such as a CD-ROM, DVD-ROM, or other optical media). In such cases, each drive may be connected to the bus 118 by one or more data media interfaces. As will be further depicted and described below, the memory 116 may include at least one program product having a set (e.g., at least one set) of program modules configured to perform operations of embodiments of the present invention. The storage system 124 (and/or the memory 116) may include a database, a data repository, or other data storage and may include various types of mechanisms for storing, accessing, and retrieving various types of data, including a hierarchical database, a collection of files in a file system, an application database in a proprietary format, a relational database management system (RDBMS), and the like. The storage system 124 may generally be included within the computing device 112 (which, as shown, employs a computer operating system such as one of the operating systems described above) and accessed via a network in any one or more of a variety of ways.

通过实例且不加以限制,具有程序模块128的集合(至少一个集合)的程序/实用程序126以及操作系统、一个或多个应用程序、其他程序模块及程序数据可存储于存储器116中。操作系统、一个或多个应用程序、其他程序模块及程序数据中的每一者或其某一组合可包括网络连接环境的实施。By way of example and not limitation, program/utility 126 having a set (at least one set) of program modules 128, as well as an operating system, one or more application programs, other program modules, and program data, may be stored in memory 116. Each or some combination of the operating system, one or more application programs, other program modules, and program data may include an implementation of a network connection environment.

计算设备112亦可经由输入/输出(I/O)接口130和/或经由网络适配器132通信。I/O接口130和/或网络适配器132可包括由计算设备112用于在计算设备112内部和/或外部的组件之间通信的物理和/或虚拟机构。举例而言,I/O接口130可与以下各者通信:诸如键盘、指点设备、显示器142等的一个或多个外部设备140;使用户能够与计算设备112交互的一个或多个设备;和/或使计算设备112能够与一个或多个其他计算设备通信的任何设备(例如,网络卡、调制解调器等)。此外,计算设备112可经由网络适配器132与诸如局域网(LAN)、一般广域网(WAN)和/或公用网络(例如,因特网)的一个或多个网络通信。因此,I/O接口130和/或网络适配器132可被配置为在计算设备112内或为其接收或发送信号或数据。如所描绘,I/O接口130及网络适配器132经由总线118与计算设备112的其他组件通信。应理解,虽然未展示,但是其他硬件和/或软件组件可与计算设备112结合使用。实例包括(但不限于):微码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器、以及数据归档存储系统等。Computing device 112 may also communicate via input/output (I/O) interface 130 and/or via network adapter 132. I/O interface 130 and/or network adapter 132 may comprise physical and/or virtual mechanisms used by computing device 112 to communicate between components within and/or external to computing device 112. For example, I/O interface 130 may communicate with one or more external devices 140, such as a keyboard, pointing device, display 142, etc.; one or more devices that enable a user to interact with computing device 112; and/or any device that enables computing device 112 to communicate with one or more other computing devices (e.g., a network card, modem, etc.). Furthermore, computing device 112 may communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), and/or a public network (e.g., the Internet), via network adapter 132. Thus, I/O interface 130 and/or network adapter 132 may be configured to receive or send signals or data within or for computing device 112. As depicted, I/O interface 130 and network adapter 132 communicate with the other components of computing device 112 via bus 118. It should be understood that, although not shown, other hardware and/or software components may be used in conjunction with computing device 112. Examples include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems.

虽然图1针对多线程系统100(及其他项目)示出单个项目,但这些表示并非意在限制及因此,任意项目可表示多个项目。举例而言,处理器114可包括多个处理核心,所述处理核心中的每一者执行多个线程且能够处理本文所述的协调式SIE退出。1 illustrates a single item for multi-threaded system 100 (and other items), these representations are not intended to be limiting and, therefore, any item may represent multiple items. For example, processor 114 may include multiple processing cores, each of which executes multiple threads and is capable of handling the coordinated SIE exits described herein.

将参考图3A-3B描述所述多线程系统,这些图示出关于等待状态及协调式SIE退出的处理流程300的一个实例。The multi-threaded system will be described with reference to Figures 3A-3B, which illustrate one example of a process flow 300 regarding wait states and coordinated SIE exits.

如图所示,处理流程300由多个线程(例如,线程X、线程Y及线程Z)执行。在块310、312及314处,线程X(例如,主线程)执行客机指令,加载已启用的等待状态PSW,并且进入固件等待状态循环。线程X在此时不退出SIE,因为线程Y及线程Z(例如,辅助线程)两者仍然正在执行客机指令流(例如,块330、340)。线程X保持处于固件等待状态循环,直至在块316处客机异步中断变为待决。在块318处,客机异步中断导致线程X退出等待状态循环并且进入固件异步中断处理程序。固件异步中断处理程序将中断旧PSW及中断信息保存至客机存储器的第一块中的固定存储位置,将客机中断新PSW加载至硬件中。接下来,在块320处,线程X开始执行客机软件中断处理程序。当线程X完成执行软件中断处理程序时,客机操作系统在块322处重新加载已启用的等待PSW,这再次调用/进入固件等待状态循环。As shown, process flow 300 is executed by multiple threads (e.g., thread X, thread Y, and thread Z). At blocks 310, 312, and 314, thread X (e.g., the main thread) executes a guest instruction, loads an enabled wait state PSW, and enters a firmware wait state loop. Thread X does not exit the SIE at this point because both thread Y and thread Z (e.g., helper threads) are still executing guest instruction streams (e.g., blocks 330 and 340). Thread X remains in the firmware wait state loop until a guest asynchronous interrupt becomes pending at block 316. At block 318, the guest asynchronous interrupt causes thread X to exit the wait state loop and enter the firmware asynchronous interrupt handler. The firmware asynchronous interrupt handler saves the old interrupt PSW and interrupt information to a fixed storage location in the first block of guest memory and loads the new guest interrupt PSW into hardware. Next, at block 320, thread X begins executing the guest software interrupt handler. When thread X completes executing the software interrupt handler, the guest operating system reloads the enabled wait PSW at block 322, which again calls/enters the firmware wait state loop.

同时,线程Y独立地在块330处执行客机指令,在块332处加载已启用的等待状态PSW,并且在块334处进入固件等待状态循环。同样,线程Z独立地在块340处执行客机指令,在块342处加载已启用的等待状态PSW,并且在块344处进入固件等待状态循环。亦即,每个线程Y、Z在某一相应时间Y1、Z1之后加载对应的已启用的等待状态PSW(块332、342),使得这些事件独立地发生。另外,每个线程Y、Z在某一相应时间Y2、Z2之后进入对应的固件等待状态PSW(块334、344),使得这些事件独立地发生。在块350处,线程X确定核心的所有有效线程(例如,线程X、Y、Z)现在处于等待状态,并且调用SIE退出以进行等待状态拦截。接下来,在线352处,线程X到达初始SIE退出同步点,这导致线程X用信号通知线程Y、Z使用内部中断机制退出SIE,如块354中所示。检测所有线程处于等待状态并且用信号通知其他线程退出SIE的处理可由任一线程执行,并且通常由进入等待状态的最后一个线程完成。Meanwhile, thread Y independently executes a guest instruction at block 330, loads an enabled wait state PSW at block 332, and enters a firmware wait state loop at block 334. Similarly, thread Z independently executes a guest instruction at block 340, loads an enabled wait state PSW at block 342, and enters a firmware wait state loop at block 344. That is, each thread Y, Z loads a corresponding enabled wait state PSW (blocks 332, 342) after a respective time Y1, Z1, allowing these events to occur independently. Additionally, each thread Y, Z enters a corresponding firmware wait state PSW (blocks 334, 344) after a respective time Y2, Z2, allowing these events to occur independently. At block 350, thread X determines that all active threads of the core (e.g., threads X, Y, Z) are now in wait states and calls an SIE exit for wait state interception. Next, at line 352, thread X reaches the initial SIE exit synchronization point, which causes thread X to signal threads Y and Z to exit the SIE using an internal interrupt mechanism, as shown in block 354. The process of detecting that all threads are in a wait state and signaling the other threads to exit the SIE can be performed by any thread and is typically completed by the last thread to enter a wait state.

从块354接收内部中断信号之后,线程Y及Z独立地退出。亦即,线程Y及Z针对SIE退出请求独立地退出它们的固件等待状态循环、处理内部中断、以及调用SIE退出(如块356及358中所指示)。最后线程Y及Z在线362、364处到达初始SIE退出同步循环。一旦所有有效线程(例如,线程X、Y、Z)均已到达初始同步点(线366),每个线程独立地完成其状态描述的更新并且指示等待状态拦截(例如,块370、372、374)。一旦每个线程(例如,线程Y、Z)已完成更新其状态描述,该线程就设定硬件控制位。具体地说,在块382处,线程Y设定硬件控制位以指示已到达最终SIE退出同步点并且停止指令执行。同样,在块384处,线程Z设定硬件控制位以指示已到达最终SIE退出同步点并且停止指令执行。接下来,在块390处,线程X(例如,主线程)等待所有线程Y、Z到达最终同步点,这意味着所有线程已完成所有状态描述更新,并且完成协调式SIE退出。最后,在块392处,线程X然后向主机呈现多线程SIE拦截,主机处理该多线程SIE拦截。After receiving the internal interrupt signal from block 354, threads Y and Z independently exit. That is, threads Y and Z independently exit their firmware wait state loops in response to the SIE exit request, handle the internal interrupt, and call SIE exit (as indicated in blocks 356 and 358). Finally, threads Y and Z reach the initial SIE exit synchronization loop at lines 362 and 364. Once all active threads (e.g., threads X, Y, and Z) have reached the initial synchronization point (line 366), each thread independently completes updating its state description and indicates wait state interception (e.g., blocks 370, 372, and 374). Once each thread (e.g., thread Y and Z) has completed updating its state description, the thread sets a hardware control bit. Specifically, at block 382, thread Y sets a hardware control bit to indicate that the final SIE exit synchronization point has been reached and instruction execution ceases. Similarly, at block 384, thread Z sets a hardware control bit to indicate that the final SIE exit synchronization point has been reached and instruction execution ceases. Next, at block 390, thread X (e.g., the main thread) waits for all threads Y and Z to reach the final synchronization point, which means that all threads have completed all state description updates and completed the coordinated SIE exit. Finally, at block 392, thread X then presents the multi-threaded SIE intercept to the host, which processes the multi-threaded SIE intercept.

作为多线程系统的关于等待状态及协调式SIE退出的另一实例,将参考图4A-B描述处理流程400。类似于处理流程300,处理流程400由多个线程(例如,线程X、线程Y及线程Z)执行。为了开始处理流程400,在块410、412及414处,线程X执行客机指令、加载已启用的等待状态PSW、以及进入固件等待状态循环。同样,在块420及430处,线程Y及线程Z也执行客机指令,这导致线程X保持处于等待状态循环而不是调用SIE退出。As another example of wait states and coordinated SIE exits in a multi-threaded system, process flow 400 will be described with reference to Figures 4A-B. Similar to process flow 300, process flow 400 is performed by multiple threads (e.g., thread X, thread Y, and thread Z). To begin process flow 400, at blocks 410, 412, and 414, thread X executes a guest instruction, loads an enabled wait state PSW, and enters a firmware wait state loop. Similarly, at blocks 420 and 430, thread Y and thread Z also execute guest instructions, which causes thread X to remain in a wait state loop rather than invoking an SIE exit.

另外,在块432处,当线程X仍然在固件等待状态循环中时,线程Z执行某一操作,该操作导致针对类型N拦截调用SIE退出。在线434处,线程Z到达初始SIE退出同步点,这转而用信号通知其他线程使用对应的内部中断机制退出SIE(例如,块436)。作为响应,在块440处线程X针对SIE退出请求退出固件等待状态循环、针对SIE退出进入固件中断处理程序、以及调用SIE退出。因此,在线442处线程X到达初始SIE退出同步点。接下来,在块444处,客机异步中断在线程X上变为待决,但它未被呈现,因为该线程已经在SIE退出中。当线程Y到达可中断点时,它在块450处针对SIE退出请求采取内部中断并且调用SIE退出。线程Y然后在线452处到达初始SIE退出同步循环。Additionally, at block 432, while thread X is still in a firmware wait state loop, thread Z performs an operation that results in a call to SIE Exit for type N interception. At line 434, thread Z reaches an initial SIE exit synchronization point, which in turn signals other threads to exit the SIE using the corresponding internal interrupt mechanism (e.g., block 436). In response, at block 440, thread X exits the firmware wait state loop for the SIE exit request, enters the firmware interrupt handler for the SIE exit, and calls SIE Exit. Thus, thread X reaches an initial SIE exit synchronization point at line 442. Next, at block 444, a guest asynchronous interrupt becomes pending on thread X, but it is not presented because the thread is already in an SIE exit. When thread Y reaches an interruptible point, it takes an internal interrupt for the SIE exit request at block 450 and calls SIE Exit. Thread Y then reaches an initial SIE exit synchronization loop at line 452.

一旦所有有效线程(例如,线程X、Y、Z)均已到达初始同步点(例如,线460),每个线程独立地完成其状态描述的更新并且指示可应用拦截(例如,块470、472、474)。例如,线程X在块470处采取等待状态拦截,因为PSW位14等于1;线程Y在块472处采取无操作拦截;以及线程Z在块474处采取原始类型N拦截。如上面针对处理流程300所描述,在该实例中,一旦每个线程Y及Z已完成其所有状态描述更新,它就已到达最终SIE退出同步点并且停止它自己的指令执行(472、474)。例如,在块482、484处,线程Y及Z设定硬件控制位以指示已到达最终SIE退出同步点并且停止指令执行。接下来,在块490处,线程X等待所有线程到达最终同步点,这意味着所有线程已完成所有状态描述更新,并且完成协调式SIE退出。最后,在块492处,线程X然后向主机呈现多线程SIE拦截,主机处理该多线程SIE拦截。Once all active threads (e.g., threads X, Y, and Z) have reached the initial synchronization point (e.g., line 460), each thread independently completes its state description update and indicates that an intercept is applicable (e.g., blocks 470, 472, and 474). For example, thread X takes a wait state intercept at block 470 because PSW bit 14 is equal to 1; thread Y takes a no-op intercept at block 472; and thread Z takes a primitive type N intercept at block 474. As described above with respect to process flow 300, in this example, once each thread Y and Z has completed all of its state description updates, it has reached the final SIE exit synchronization point and ceases its own instruction execution (472, 474). For example, at blocks 482 and 484, threads Y and Z set hardware control bits to indicate that the final SIE exit synchronization point has been reached and cease instruction execution. Next, at block 490, thread X waits for all threads to reach the final synchronization point, which means that all threads have completed all state description updates and completed the coordinated SIE exit. Finally, at block 492, Thread X then presents the multi-threaded SIE intercept to the host, which processes the multi-threaded SIE intercept.

例如,可经由警告跟踪中断用信号通知非多线程客机操作系统其时间片即将到期。系统管理程序使用主机CPU计时器来确定一个客机处理器核心的时间片何时到期,使得另一客机核心可开始其时间片。另外,系统管理程序可通过在目标状态描述中设定位,从另一处理器远程地指示应该向客机逻辑核心呈现警告跟踪中断。当机器在宽限期未活动的期间检测到主机计时器中断为待决,或者机器在状态描述中检测到警告跟踪中断为待决时,它进入宽限期。宽限期通过向时间片添加最小额外时间来实施,并且当被启用时,经由警告跟踪中断用信号通知客机操作系统其时间片即将到期。该额外时间允许能够识别警告跟踪中断的客机在离开处理器之前采取适当操作(通常称为“清理”);此类操作例如可包括释放系统级锁。一旦客机已完成其清理,预期通过发出诊断确认来用信号通知清理完成(例如,客机执行具有指示警告跟踪确认的代码“049C”的DIAGNOSE指令)。如果在宽限期到期之前发出DIAG“049C”警告跟踪中断确认,则系统通过指令拦截而拦截回系统管理程序,并且系统管理程序将其作为时间片的结束来处理。相反,如果在客机操作系统已发出DIAG“049C”警告跟踪中断确认之前宽限期到期,则呈现主机计时器中断,并且系统管理程序处理时间片结束。For example, a non-multithreaded guest operating system can be signaled via a warning trace interrupt that its time slice is about to expire. The hypervisor uses the host CPU timer to determine when a guest processor core's time slice has expired, allowing another guest core to begin its time slice. Additionally, the hypervisor can remotely indicate from another processor that a warning trace interrupt should be presented to a guest logical core by setting a bit in the target state description. A machine enters a grace period when it detects a host timer interrupt as pending during a grace period of inactivity, or when it detects a warning trace interrupt as pending in the state description. The grace period is implemented by adding a minimum extra time to the time slice and, when enabled, signals the guest operating system via a warning trace interrupt that its time slice is about to expire. This extra time allows guests that are aware of the warning trace interrupt to take appropriate action (often referred to as "cleanup") before leaving the processor; such action may include, for example, releasing a system-level lock. Once a guest has completed its cleanup, it is expected to signal the completion of the cleanup by issuing a diagnostic acknowledgement (e.g., the guest executes the DIAGNOSE instruction with the code "049C" indicating a warning trace acknowledgement). If a DIAG "049C" warning trace interrupt confirmation is issued before the grace period expires, the system intercepts the interrupt back to the hypervisor through instruction interception, and the hypervisor handles this as the end of the time slice. Conversely, if the grace period expires before the guest operating system issues a DIAG "049C" warning trace interrupt confirmation, a host timer interrupt is generated, and the hypervisor handles the end of the time slice.

现在将描述在所述多线程系统中执行的警告跟踪中断(“WTI”)处理。当多线程在客户机中活动时,系统管理程序在核心的基础上管理客机时间片。存在单个主机计时器,并且其关联的中断指示客机时间片何时已针对核心中的所有线程结束。另外,当系统管理程序在主状态描述中使WTI待决时,多线程系统的责任是在辅助状态描述中使WTI中断待决。当发生主机计时器中断时,或者当在主状态描述中检测到待决WTI时,核心进入宽限期。所产生的WTI中断保持待决,并且当被启用时,分别在每个有效客机线程上呈现。如上文所描述,在适当时,加载已启用的等待的客机进入固件等待状态循环。然而,如果宽限期是活动的或者当加载已启用的等待状态时WTI待决,则客机将改为进入SIE退出同步循环。两个循环之间的区别在于等待状态循环将处理待决中断,这可能延长完成SIE退出所需的时间,并且将与响应于WTI而期望的结果直接相反。The warning trace interrupt ("WTI") processing performed in the multi-threaded system will now be described. When multi-threading is active in a guest, the hypervisor manages guest time slices on a core-by-core basis. A single host timer exists, and its associated interrupt indicates when a guest time slice has ended for all threads in the core. Additionally, when the hypervisor sets a WTI pending in the primary state description, it is the multi-threaded system's responsibility to set a WTI interrupt pending in the secondary state description. When a host timer interrupt occurs, or when a pending WTI is detected in the primary state description, the core enters a grace period. The resulting WTI interrupt remains pending and, when enabled, is presented to each active guest thread. As described above, a guest loaded with enabled waits enters a firmware wait state loop when appropriate. However, if the grace period is active or a WTI is pending when an enabled wait state is loaded, the guest will instead enter an SIE exit synchronization loop. The difference between the two loops is that the wait state loop will process pending interrupts, which may extend the time required to complete an SIE exit and directly contradict the desired result of responding to a WTI.

将参考图5描述所述多线程系统,图5示出关于WTI及核心分派的处理流程500的一个实例。如图所示,处理流程500从警告跟踪的角度描述主机处理器计时器(“CPT”)中断的处理。如果CPT变为待决并且启用主机以采取该中断,则调用固件以处理该中断。亦即,处理流程500在决策块502处检查处理器核心是否正在主机模式下运行。如果核心正在主机模式下运行,则处理流程500进行至块504,在该块处呈现主机CPT中断(例如,如通过“是”箭头所指示)。如果核心未在主机模式下运行(例如,如通过“否”箭头所指示),则它正在客机模式下运行并且处理流程500进行至决策块506。The multi-threaded system will be described with reference to FIG5 , which illustrates an example of a process flow 500 for WTI and core dispatching. As shown, process flow 500 describes the handling of a host processor timer ("CPT") interrupt from the perspective of alert tracking. If the CPT becomes pending and the host is enabled to take the interrupt, firmware is called to handle the interrupt. That is, process flow 500 checks at decision block 502 whether the processor core is running in host mode. If the core is running in host mode, process flow 500 proceeds to block 504 where the host CPT interrupt is presented (e.g., as indicated by a "yes" arrow). If the core is not running in host mode (e.g., as indicated by a "no" arrow), it is running in guest mode and process flow 500 proceeds to decision block 506.

在决策块506处,处理流程500检查宽限期是否活动。当宽限期尚未在进行中时,处理流程500进行(例如,如通过“否”箭头所指示)以在决策块508处判定是否针对该客机支持警告跟踪。当支持警告跟踪时,处理流程500进行至块510(例如,如通过“是”箭头所指示)以在该核心的主状态描述中设定T位,该T位驻留于状态描述中并且指示警告跟踪请求待决。否则,如果宽限期未在进行中和/或不支持警告跟踪,则处理流程500进行至块512。在块512处,调用SIE退出,因此能够向主机呈现主机CPT中断,并且在客机多线程模式下,用信号通知其他线程退出SIE。此行为与非多线程环境中的WTI行为相同,只是在多线程环境中,当要呈现主机CPT中断时,用信号通知其他线程退出SIE。At decision block 506, process flow 500 checks whether a grace period is active. If a grace period is not in progress, process flow 500 proceeds (e.g., as indicated by a "no" arrow) to determine at decision block 508 whether warning tracing is supported for the guest. If warning tracing is supported, process flow 500 proceeds to block 510 (e.g., as indicated by a "yes" arrow) to set the T bit in the core's main state description, which resides in the state description and indicates that a warning tracing request is pending. Otherwise, if a grace period is not in progress and/or warning tracing is not supported, process flow 500 proceeds to block 512. At block 512, an SIE exit is called, thereby enabling a host CPT interrupt to be presented to the host, and in guest multithreaded mode, other threads are signaled to exit the SIE. This behavior is identical to WTI behavior in a non-multithreaded environment, except that in a multithreaded environment, other threads are signaled to exit the SIE when a host CPT interrupt is to be presented.

现在将描述结合所述多线程系统的协调式SIE退出的WTI。为了实施当采取客机中断时用信号通知其他线程退出SIE,不应该当WTI待决或者核心在宽限期内时执行此类信号通知。相反,在发生SIE退出之前,多线程系统将为其他线程提供完成其清理并发出诊断确认(例如,客机执行具有指示警告跟踪确认的代码“049C”的DIAGNOSE指令)的机会。如果在所有有效线程已同步之前宽限期到期,则将用信号通知剩余线程退出。The WTI in conjunction with the coordinated SIE exit of the multi-threaded system will now be described. To implement the signaling of other threads to exit the SIE when a guest interrupt is taken, such signaling should not be performed while a WTI is pending or the core is within a grace period. Instead, before an SIE exit occurs, the multi-threaded system will provide other threads with an opportunity to complete their cleanup and issue a diagnostic acknowledgement (e.g., the guest executes a DIAGNOSE instruction with a code "049C" indicating a warning trace acknowledgement). If the grace period expires before all active threads have synchronized, the remaining threads will be signaled to exit.

在多线程环境中,任何现有处理器将保持处于SIE退出同步循环,直至所有其他有效处理器1)在宽限期内进入等待状态,2)当核心进入宽限期时处于等待状态,3)由于独立原因退出SIE,包括由于在发出DIAG 049C以指示清理完成之后的指令拦截,或者4)响应于来自另一线程的信号通知而退出SIE。典型及期望的情况是所有线程将在宽限期到期之前独立地完成清理并且发出DIAG 049C WTI确认,或者当在该核心上进入宽限期时将处于等待状态。警告跟踪的多线程特定行为是在宽限期内SIE退出信号通知的延迟,以试图允许每个线程上的操作系统在被从处理器移除之前进行清理。In a multithreaded environment, any active processor will remain in the SIE exit synchronization loop until all other active processors 1) enter a wait state within the grace period, 2) are in a wait state when the core enters the grace period, 3) exit the SIE for independent reasons, including due to an instruction intercept after issuing DIAG 049C to indicate cleanup completion, or 4) exit the SIE in response to signaling from another thread. The typical and expected situation is that all threads will independently complete cleanup and issue DIAG 049C WTI confirmation before the grace period expires, or will be in a wait state when the grace period is entered on that core. A multithreaded specific behavior of the warning trace is the delay of SIE exit signaling within the grace period to attempt to allow the operating system on each thread to clean up before being removed from the processor.

将参考图6A-6C描述所述多线程系统,图6A-6C示出关于核心分派环境中的警告跟踪的处理流程600的一个实例。一般而言,处理流程600示出一旦警告跟踪请求未决在任何给定线程上的行为。因此,当针对任何线程(例如,主线程或辅助线程)开启T位时,处理流程600在块602处开始。当处理主机计时器中断时可以由多线程系统(如图5中所示)或者由系统管理程序设定主状态描述中的T位。一旦多线程系统检测到T位,多线程系统在决策块604处判定核心是否在宽限期内。如果核心未在宽限期内(例如,如通过“否”箭头所指示),则多线程系统在决策块606处判定核心是否正在客机多线程环境中运行。当核心正在客机多线程环境中运行时,处理流程600进行至块608,在块608处多线程系统针对状态描述组中的所有有效辅助线程设定辅助状态描述中的T位。注意,仅当正在主线程上执行该处理流程时,才将T位传播至辅助线程的状态描述。另外,无论核心是否正在客机多线程环境中运行,处理600都进行至块610,在块610处核心进入宽限期(例如,假设开启T位,如在块602中所见,以及未进入宽限期,如在块604中所见)。进入宽限期包括少量延长客机时间片及设定宽限期是活动的指示。即使不能向任何或所有线程呈现WTI,宽限期也会开始。接下来,在决策块612处,多线程系统判定是否针对WTI启用了客机线程。当多线程系统判定针对WTI启用了客机线程时,则在块614处呈现中断,并且客机操作系统可在616处采取适当操作,例如开始清理(处理流程600然后经由流程连接符“a”进行至图6B的决策块618)。当多线程系统判定未针对WTI启用客机时,则不能呈现WTI并且客机执行继续,直至它变为启用或者直至发生另一SIE退出条件(处理流程600然后经由流程连接符“b”进行至图6C的决策块642)。The multi-threaded system will be described with reference to Figures 6A-6C, which illustrate an example process flow 600 for warning tracking in a core dispatch environment. Generally speaking, process flow 600 illustrates the behavior of any given thread once a warning tracking request is pending. Thus, process flow 600 begins at block 602 when the T bit is enabled for any thread (e.g., a main thread or an auxiliary thread). The T bit in the main state description can be set by the multi-threaded system (as shown in Figure 5) or by the hypervisor when processing a host timer interrupt. Once the multi-threaded system detects the T bit, it determines at decision block 604 whether the core is within a grace period. If the core is not within a grace period (e.g., as indicated by a "no" arrow), the multi-threaded system determines at decision block 606 whether the core is running in a guest multi-threaded environment. If the core is running in a guest multi-threaded environment, process flow 600 proceeds to block 608, where the multi-threaded system sets the T bit in the auxiliary state description for all active auxiliary threads in the state description group. Note that the T bit is propagated to the state description of the auxiliary thread only when this process flow is being executed on the main thread. Furthermore, regardless of whether the core is running in a guest multithreaded environment, process 600 proceeds to block 610, where the core enters a grace period (e.g., assuming the T bit is on, as seen in block 602, and not entering a grace period, as seen in block 604). Entering a grace period involves extending the guest time slice by a small amount and setting an indication that the grace period is active. The grace period begins even if a WTI cannot be presented to any or all threads. Next, at decision block 612, the multithreaded system determines whether the guest thread is enabled for WTI. If the multithreaded system determines that the guest thread is enabled for WTI, an interrupt is presented at block 614, and the guest operating system can take appropriate action at 616, such as initiating cleanup (process flow 600 then proceeds to decision block 618 of FIG. 6B via process connector "a"). When the multithreaded system determines that the guest is not enabled for WTI, then WTI cannot be presented and guest execution continues until it becomes enabled or until another SIE exit condition occurs (process flow 600 then proceeds to decision block 642 of FIG. 6C via flow connector “b”).

如图6B中所示,一旦已向客机呈现WTI中断,多线程系统就在完成清理的同时监视特定条件。处理流程600进行至决策块618,在块618处多线程系统判定是否在清理完成之前宽限期已结束。如果宽限期已结束(例如,如通过“是”箭头所指示),则处理流程600进行至块620,在块620处调用SIE退出并且用信号通知其他线程退出。注意,如果由于任何其他原因在宽限期内调用SIE退出,则不用信号通知其他线程以便为它们提供完成其清理的时间。如果宽限期未结束(例如,如通过“否”箭头所指示),则处理流程600进行至决策块622,在块622处多线程系统判定是否在清理完成之前加载了等待状态PSW。当加载了等待状态PSW时(例如,如通过“是”箭头所指示),处理流程600进行至块624,在块624处在该线程上呈现等待状态拦截。如果未加载等待状态PSW(例如,如通过“否”箭头所指示),则处理流程600进行至决策块626,在块626处多线程系统判定是否在清理完成之前发生客机拦截。如果发生客机拦截(例如,如通过“是”箭头所指示),则处理流程600进行至块628,在块628处在该线程上采取该拦截。如果未发生客机拦截(例如,如通过“否”箭头所指示),则处理流程600进行至决策块630,在块630处多线程系统判定是否在清理完成之前发生主机中断。如果发生主机中断(例如,如通过“是”箭头所指示),则处理流程600进行至块632,在块632处调用SIE退出,因此能够呈现中断。如果未发生主机中断(例如,如通过“否”箭头所指示),则处理流程600进行至决策块634,在块634处多线程系统判定是否在清理完成之前接收到来自另一线程的SIE退出请求。如果从另一线程接收到SIE退出请求(例如,如通过“是”箭头所指示),则处理流程600进行至块636,在块636处在该线程上发生无操作拦截。如果未从另一线程接收SIE退出请求(例如,如通过“否”箭头所指示),则处理流程600进行至块638,在块638处如果客机操作系统能够完成清理并且在发生任何其他条件之前,则发出DIAG“049C”WTI确认。接下来,在块640处,发生DIAG的指令拦截。一旦所有线程已到达SIE退出最终同步循环,则在主线程上向主机呈现客机拦截(多个)和/或主机中断。As shown in FIG6B , once the WTI interrupt has been presented to the guest, the multi-threaded system monitors for certain conditions while completing the cleanup. Process flow 600 proceeds to decision block 618, where the multi-threaded system determines whether a grace period has expired before the cleanup is complete. If the grace period has expired (e.g., as indicated by a "yes" arrow), process flow 600 proceeds to block 620, where an SIE exit is called and the other threads are signaled to exit. Note that if an SIE exit is called within the grace period for any other reason, the other threads are not signaled to allow them time to complete their cleanup. If the grace period has not expired (e.g., as indicated by a "no" arrow), process flow 600 proceeds to decision block 622, where the multi-threaded system determines whether a wait-state PSW has been loaded before the cleanup is complete. If a wait-state PSW has been loaded (e.g., as indicated by a "yes" arrow), process flow 600 proceeds to block 624, where a wait-state intercept is presented on the thread. If the wait state PSW is not loaded (e.g., as indicated by a "no" arrow), process flow 600 proceeds to decision block 626, where the multi-threaded system determines whether a guest intercept occurs before the cleanup is complete. If a guest intercept occurs (e.g., as indicated by a "yes" arrow), process flow 600 proceeds to block 628, where the intercept is taken on the thread. If a guest intercept does not occur (e.g., as indicated by a "no" arrow), process flow 600 proceeds to decision block 630, where the multi-threaded system determines whether a host interrupt occurs before the cleanup is complete. If a host interrupt occurs (e.g., as indicated by a "yes" arrow), process flow 600 proceeds to block 632, where an SIE exit is called so that the interrupt can be presented. If no host interrupt has occurred (e.g., as indicated by a "no" arrow), process flow 600 proceeds to decision block 634, where the multi-threaded system determines whether a SIE exit request has been received from another thread before cleanup is complete. If a SIE exit request has been received from another thread (e.g., as indicated by a "yes" arrow), process flow 600 proceeds to block 636, where a no-op intercept occurs on that thread. If no SIE exit request has been received from another thread (e.g., as indicated by a "no" arrow), process flow 600 proceeds to block 638, where a DIAG "049C" WTI acknowledgment is issued if the guest operating system is able to complete cleanup and before any other conditions occur. Next, at block 640, a DIAG instruction intercept occurs. Once all threads have reached the SIE exit final synchronization cycle, the guest intercept(s) and/or host interrupt are presented to the host on the main thread.

如图6C中所示,如果未启用WTI中断,则客机线程继续监视WTI中断的启用,使得将发生清理,并且监视包括宽限期结束的其他条件。处理流程600进行至决策块642,在块642处多线程系统判定是否在WTI变为启用并且向软件呈现中断之前宽限期已结束。如果宽限期已结束(例如,如通过“是”箭头所指示),则处理流程600进行至块620,在块620处调用SIE退出并且用信号通知其他线程退出。再次注意,如果由于任何其他原因在宽限期内调用SIE退出,则不用信号通知其他线程以便为它们提供完成其清理的时间。如果宽限期未结束(例如,如通过“否”箭头所指示),则处理流程600进行至决策块644,在块644处多线程系统判定是否在呈现WTI之前加载了等待状态PSW。如果加载了等待状态PSW(例如,如通过“是”箭头所指示),则处理流程600进行至块624,在块624处在该线程上呈现等待状态拦截。如果未加载等待状态PSW(例如,如通过“否”箭头所指示),则处理流程600进行至决策块646,在块646处多线程系统判定该线程是否需要客机拦截。如果发生客机拦截(例如,如通过“是”箭头所指示),则处理流程600进行至块628,在块628处在该线程上采取拦截。如果未发生客机拦截(例如,如通过“否”箭头所指示),则处理流程600进行至决策块648,在块648处多线程系统判定是否在呈现WTI之前发生了主机中断。如果发生了主机中断(例如,如通过“是”箭头所指示),则处理流程600进行至块632,在块632处调用SIE退出,因此能够呈现中断。如果未发生主机中断(例如,如通过“否”箭头所指示),则处理流程600进行至决策块650,在块650处多线程系统判定是否接收到来自另一线程的SIE退出请求。如果从另一线程接收到SIE退出请求(例如,如通过“是”箭头所指示),则处理流程600进行至块636,在块636处发生无操作拦截。如果未从另一线程接收到SIE退出请求(例如,如通过“否”箭头所指示),则处理流程600进行至图6A的决策块612(经由流程连接符“c”),在块612处多线程系统判定是否针对WTI启用了客机。As shown in FIG6C , if the WTI interrupt is not enabled, the guest thread continues to monitor for the WTI interrupt to enable so that cleanup will occur, and monitors for other conditions, including the expiration of the grace period. Process flow 600 proceeds to decision block 642, where the multi-threaded system determines whether the grace period has expired before the WTI becomes enabled and the interrupt is presented to the software. If the grace period has expired (e.g., as indicated by the “yes” arrow), process flow 600 proceeds to block 620, where the SIE exit is called and the other threads are signaled to exit. Note again that if the SIE exit is called within the grace period for any other reason, the other threads are not signaled to provide them with time to complete their cleanup. If the grace period has not expired (e.g., as indicated by the “no” arrow), process flow 600 proceeds to decision block 644, where the multi-threaded system determines whether the wait-state PSW was loaded before presenting the WTI. If a wait-state PSW is loaded (e.g., as indicated by a "yes" arrow), process flow 600 proceeds to block 624, where a wait-state intercept is presented on the thread. If a wait-state PSW is not loaded (e.g., as indicated by a "no" arrow), process flow 600 proceeds to decision block 646, where the multi-threaded system determines whether a guest intercept is required for the thread. If a guest intercept occurs (e.g., as indicated by a "yes" arrow), process flow 600 proceeds to block 628, where an intercept is taken on the thread. If a guest intercept does not occur (e.g., as indicated by a "no" arrow), process flow 600 proceeds to decision block 648, where the multi-threaded system determines whether a host interrupt occurs before presenting the WTI. If a host interrupt occurs (e.g., as indicated by a "yes" arrow), process flow 600 proceeds to block 632, where an SIE exit is called so that the interrupt can be presented. If a host interrupt has not occurred (e.g., as indicated by a "no" arrow), process flow 600 proceeds to decision block 650, where the multi-threaded system determines whether an SIE exit request has been received from another thread. If an SIE exit request has been received from another thread (e.g., as indicated by a "yes" arrow), process flow 600 proceeds to block 636, where a no-op intercept occurs. If an SIE exit request has not been received from another thread (e.g., as indicated by a "no" arrow), process flow 600 proceeds to decision block 612 of FIG. 6A (via flow connector "c"), where the multi-threaded system determines whether the guest is enabled for WTI.

还可扩展多线程环境中的WTI,以包含在执行SIE退出同步信号通知之前另外用信号通知操作系统。在对导致SIE退出的中断或拦截的预期系统管理程序响应将是分派另一不同的客机核心的情况下,使用WTI向仍在执行的线程警告它们即将被从处理器移除通常是有益的。WTI in a multithreaded environment can also be extended to include additional signaling to the operating system before performing the SIE exit synchronization signaling. In cases where the expected hypervisor response to an interrupt or intercept that causes a SIE exit is to dispatch a different guest core, it is often beneficial to use WTI to warn still executing threads that they are about to be removed from the processor.

一般而言,计算设备可包括处理器(例如,图1的处理器114)及计算机可读存储介质(例如,图1的存储器116),其中处理器接收计算机可读程序指令(例如,来自计算机可读存储介质)且执行这些指令,藉此执行一个或多个处理,包括本文所述的处理中的一者或多者。In general, a computing device may include a processor (e.g., processor 114 of FIG. 1 ) and a computer-readable storage medium (e.g., memory 116 of FIG. 1 ), wherein the processor receives computer-readable program instructions (e.g., from the computer-readable storage medium) and executes these instructions, thereby performing one or more processes, including one or more of the processes described herein.

可自使用以一种或多种编程语言的任何组合编写的编译器指令、指令集架构(ISA)指令、机器指令、机器相关指令、微码、固件指令、状态设定数据或源代码或目标程序代码产生的计算机程序编译或解译计算机可读程序指令,所述一种或多种编程语言包括诸如Smalltalk、C++或其类似者的面向对象式编程语言,及常规过程式编程语言,诸如“C”编程语言或类似编程语言。计算机可读程序指令可完全在计算设备上执行,部分在计算设备上执行,作为独立软件包执行,部分在本地计算设备上执行且部分在远程计算机设备上执行,或完全在远程计算机设备上执行。在后一情形中,远程计算机可经由任一类型的网络(包括局域网(LAN)或广域网(WAN))连接至本地计算机,或可(例如,经由使用因特网服务提供商的因特网)连接至外部计算机。在一些实施例中,电子电路(包括(例如)可编程逻辑电路、场可编程门阵列(FPGA)或可编程逻辑阵列(PLA))可通过利用计算机可读程序指令的状态信息将电子电路个性化来执行计算机可读程序指令,以便执行本发明的方面。本文所述的计算机可读程序指令亦可经由网络自计算机可读存储介质下载至相应计算/处理设备或下载至外部计算机或外部存储设备(例如,支持通信的计算设备及连接的任意组合)。举例而言,网络可为因特网、局域网、广域网和/或无线网络,包括铜传输线缆、光传输光纤、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器,且利用多种通信技术,诸如无线电技术、蜂窝技术等。Computer-readable program instructions may be compiled or interpreted from a computer program generated using compiler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object program code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, or the like, and conventional procedural programming languages such as the "C" programming language or similar programming languages. The computer-readable program instructions may be executed entirely on a computing device, partially on a computing device, as a stand-alone software package, partially on a local computing device and partially on a remote computing device, or entirely on a remote computing device. In the latter case, the remote computer may be connected to the local computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits (including, for example, programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs)) can execute computer-readable program instructions by personalizing the electronic circuits using state information of the computer-readable program instructions so as to perform aspects of the present invention. The computer-readable program instructions described herein can also be downloaded from a computer-readable storage medium to a corresponding computing/processing device or to an external computer or external storage device (e.g., any combination of computing devices and connections that support communication) via a network. For example, the network can be the Internet, a local area network, a wide area network, and/or a wireless network, including copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers, and utilizing a variety of communication technologies, such as radio technology, cellular technology, etc.

计算机可读存储介质可为保持及存储由指令执行设备(例如,如上文所描述的计算设备)使用的指令的有形设备。计算机可读存储介质可为(例如,但不限于)电子存储设备、磁性存储设备、光学存储设备、电磁存储设备、半导体存储设备或前述各者的任何合适组合。计算机可读存储介质的更特定实例的非穷尽性列表包括以下项:便携计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携光盘只读存储器(CD-ROM)、数字化通用光盘(DVD)、记忆棒、软盘、机械编码的设备(诸如其上记录有指令的打孔卡片或凹槽中的凸起结构)及前述各项的任何合适组合。如本文中所使用,不将计算机可读存储介质本身理解为暂时性信号,诸如无线电波或其他自由传播的电磁波、经由波导或其他传输介质传播的电磁波(例如,经由光缆传递的光脉冲),或经由导线传输的电信号。A computer-readable storage medium may be a tangible device that holds and stores instructions used by an instruction execution device (e.g., a computing device as described above). A computer-readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of computer-readable storage media includes the following: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanically encoded device (such as a punch card or a raised structure in a groove on which instructions are recorded), and any suitable combination of the foregoing. As used herein, a computer-readable storage medium itself is not understood to be a temporary signal, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated via a waveguide or other transmission medium (e.g., a light pulse transmitted via an optical cable), or an electrical signal transmitted via a wire.

因此,所述多线程系统和方法和/或其组件可作为一个或多个计算设备上的计算机可读程序指令实施,这些指令存储在与之相关联的计算机可读存储介质上。计算机程序产品可包括存储在计算机可读存储介质上的此类计算机可读程序指令以用于执行和/或使处理器执行多线程系统和方法的操作。所述多线程系统和方法和/或其组件(如所实施和/或所要求保护的)改进计算机和/或处理器自身的功能,因为所利用的等待状态及警告跟踪结合协调式开始解释执行退出降低了资源成本。另外,所述多线程系统、方法和/或计算机程序产品提供在多线程环境中提供等待状态及警告跟踪支持的更有效手段。例如,在共享环境中运行的第一线程的修改后的等待状态延迟开始解释执行退出,直至共享环境的所有线程处于修改后的等待状态。在宽限期内,警告跟踪延迟线程之间的信号通知以开始协调式开始解释执行退出,以便为每个线程提供在它们退出之前的“清理”时间。Thus, the multi-threaded system and method and/or its components may be implemented as computer-readable program instructions on one or more computing devices, these instructions being stored on a computer-readable storage medium associated therewith. A computer program product may include such computer-readable program instructions stored on a computer-readable storage medium for executing and/or causing a processor to execute the operations of the multi-threaded system and method. The multi-threaded system and method and/or its components (as implemented and/or claimed) improve the functionality of the computer and/or processor itself because the wait state and warning tracking utilized in conjunction with the coordinated start of interpreted execution exit reduces resource costs. In addition, the multi-threaded system, method and/or computer program product provides a more efficient means of providing wait state and warning tracking support in a multi-threaded environment. For example, a modified wait state of a first thread running in a shared environment delays the start of interpreted execution exit until all threads of the shared environment are in the modified wait state. During a grace period, warning tracking delays signaling between threads to initiate a coordinated start of interpreted execution exit so as to provide each thread with "cleanup" time before they exit.

换言之,所述改进包括提供这样的机制:使核心保持分派,直至该核心上的所有线程已在共享物理处理器环境中进入等待状态;识别到核心中的线程处于“清理”处理中并且延迟用信号通知其他线程进行“立即”SIE退出以便为它们提供在被强制退出之前完成清理的机会;以及利用对警告跟踪中断工具的使用以在多线程环境中更有效地退出SIE。In other words, the improvements include providing mechanisms to: keep a core dispatched until all threads on that core have entered wait states in a shared physical processor environment; recognize that threads in a core are in the "cleanup" process and delay signaling other threads for "immediate" SIE exit to provide them with an opportunity to complete cleanup before being forced to exit; and leverage the use of warning trace interrupt facilities to more efficiently exit the SIE in a multi-threaded environment.

本文参考根据本发明的实施例的方法、装置(系统)及计算机程序产品的流程图和/或方块图描述本发明的多个方面。应理解,可通过计算机可读程序指令实现流程图和/或方块图的每个块,及流程图和/或方块图中的块的组合。Various aspects of the present invention are described herein with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each block of the flowcharts and/or block diagrams, and combinations of blocks in the flowcharts and/or block diagrams, can be implemented by computer-readable program instructions.

可将这些计算机可读程序指令提供至通用计算机、专用计算机或其他可编程数据处理装置的处理器以产生机器,以使得经由所述计算机或其他可编程数据处理装置的处理器执行的指令创建用于实现一个或多个流程图和/或方块图块中所指定的操作/动作的构件。亦可将这些计算机可读程序指令存储于计算机可读存储介质中,这些指令可引导计算机、可编程数据处理装置和/或其他设备以特定方式操作,使得存储有指令的计算机可读存储介质包括制品,所述制品包括实现一个或多个流程图和/或方块图块中指定的操作/动作的多个方面的指令。These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device create a component for implementing the operations/actions specified in one or more flowcharts and/or block diagrams. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions can direct the computer, programmable data processing device, and/or other equipment to operate in a specific manner, so that the computer-readable storage medium storing the instructions includes an article of manufacture, which includes instructions for implementing multiple aspects of the operations/actions specified in one or more flowcharts and/or block diagrams.

计算机可读程序指令亦可加载至计算机、其他可编程数据处理装置或其他设备上,以使一系列操作步骤在所述计算机、其他可编程装置或其他设备上执行以产生计算机实现的处理,使得在所述计算机、其他可编程装置或其他设备上执行的指令实现一个或多个流程图和/或方块图块中所指定的操作/动作。Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are performed on the computer, other programmable apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable apparatus, or other device implement the operations/actions specified in one or more flowcharts and/or block diagram blocks.

附图中的流程图及方块图示出根据本发明的各种实施例的系统、方法及计算机程序产品的可能实施方式的架构、可操作性及操作。就此而言,流程图或方块图中的每个块可表示指令的模块、区段或部分,其包括用于实现指定逻辑运算的一个或多个可执行指令。在一些备选实施方式中,块中提及的操作可不按附图中所提及的次序发生。举例而言,视所涉及的可操作性而定,以连续方式展示的两个块实际上可基本上同时执行,或这些块有时可以以相反次序执行。亦应注意,可通过执行指定操作或动作或执行专用硬件及计算机指令的组合的基于硬件的专用系统实现方块图和/或流程图的每个块,及方块图和/或流程图中的块的组合。The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, operability and operation of possible implementations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, segment or portion of an instruction, which includes one or more executable instructions for implementing a specified logical operation. In some alternative embodiments, the operations mentioned in the blocks may not occur in the order mentioned in the accompanying drawings. For example, depending on the operability involved, two blocks shown in a continuous manner may actually be executed substantially simultaneously, or the blocks may sometimes be executed in the opposite order. It should also be noted that each block of the block diagram and/or flowchart, and the combination of blocks in the block diagram and/or flowchart, can be implemented by a hardware-based dedicated system that performs the specified operation or action or executes a combination of dedicated hardware and computer instructions.

已出于例示目的呈现本发明的各实施例的描述,但这些描述并不意欲为穷举的或限于所披露的实施例。在不背离所描述实施例的范围及精神的情况下,对于本领域技术人员而言,许多修改及变化将显而易见。本文中所使用术语经选择以最佳地解释实施例的原理、实际应用或相较于市场中发现的技术的技术改进,或使得本领域技术人员能够理解本文所披露的实施例。The descriptions of the various embodiments of the present invention have been presented for illustrative purposes, but are not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, practical applications, or technical improvements over technologies found in the marketplace, or to enable those skilled in the art to understand the embodiments disclosed herein.

本文中所使用的术语仅出于描述特定实施例的目的,且并不意欲限制本发明。如本文中所使用,除非上下文另外清楚地指示,否则单数形式“一”及“该”意欲同样包括复数形式。将进一步理解,当在本说明书中使用时,术语“包括”指定所陈述特征、整体、步骤、操作、元素和/或组件的存在,但不排除一个或多个其他特征、整体、步骤、操作、元素和/或其组合的存在或添加。The terms used herein are for the purpose of describing specific embodiments only and are not intended to limit the present invention. As used herein, unless the context clearly indicates otherwise, the singular forms "a," "an," and "the" are intended to include the plural forms as well. It will be further understood that when used in this specification, the term "comprising" specifies the presence of stated features, integers, steps, operations, elements, and/or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, and/or combinations thereof.

本文描绘的流程图仅为一实例。在不背离本发明的范围的情况下,可存在本文描述的图或步骤(或操作)的多个变体。举例来说,可以不同次序执行所述步骤或可添加、删除或修改步骤。所有这些变体被视为所要求保护的发明的一部分。The flowcharts depicted herein are merely examples. Multiple variations of the figures or steps (or operations) described herein may exist without departing from the scope of the present invention. For example, the steps may be performed in a different order or steps may be added, deleted, or modified. All of these variations are considered part of the claimed invention.

虽然已描述本发明的优选实施例,但将理解,本领域技术人员现在及将来可进行属于随后的权利要求书范围内的各种改进及增强。这些权利要求应被视为维护对最初描述的本发明的恰当保护。While the preferred embodiment to the invention has been described, it will be understood that those skilled in the art, both now and in the future, may make various improvements and enhancements which fall within the scope of the claims which follow. These claims should be construed to maintain the proper protection for the invention first described.

Claims (11)

1.一种在计算机处理器核心上执行多个线程的方法,所述多个线程包括第一线程和一组剩余线程,所述方法包括:1. A method for executing multiple threads on a computer processor core, said multiple threads including a first thread and a group of remaining threads, the method comprising: 确定存在开始解释执行退出条件;It has been determined that an exit condition for initiating interpretation and execution exists; 确定所述计算机处理器核心在宽限期内;It was determined that the computer processor core was within the grace period; 所述第一线程进入开始解释执行退出同步循环而不用信号通知所述一组剩余线程中的任一者;The first thread enters the process of interpreting and executing before exiting the synchronization loop without notifying any of the remaining threads in the group. 所述第一线程保持处于所述开始解释执行退出同步循环,直至所述宽限期到期或者所述剩余线程中的每一者进入对应的开始解释执行退出同步循环;The first thread remains in the start-interpretation-execution-exit synchronization loop until the grace period expires or each of the remaining threads enters the corresponding start-interpretation-execution-exit synchronization loop. 确定对于所述计算机处理器核心,所述宽限期已到期;以及It has been determined that the grace period for the computer processor core has expired; and 基于所述宽限期的到期,由所述第一线程用信号通知所述剩余线程中的每一者进行至所述对应的开始解释执行退出同步循环。Upon the expiration of the grace period, the first thread signals each of the remaining threads to proceed to the corresponding start of interpretation execution and exit the synchronization loop. 2.如权利要求1所述的方法,进一步包括:2. The method of claim 1, further comprising: 确定对于警告跟踪中断,所述第一线程为待决的;It was determined that the first thread was pending in response to the warning tracing interruption; 由所述第一线程将警告跟踪中断待决条件传播至剩余线程中的每一者;以及The first thread propagates the warning trace interruption pending condition to each of the remaining threads; and 由所述第一线程导致所述计算机处理器核心进入所述宽限期。The first thread causes the computer processor core to enter the grace period. 3.如权利要求1所述的方法,进一步包括:3. The method of claim 1, further comprising: 确定对于所述第一线程,等待状态为待决的;It is determined that for the first thread, the waiting state is pending; 确定对于所述第一线程,存在警告跟踪中断待决条件;以及It was determined that for the first thread, a warning tracing interruption pending condition existed; and 基于确定存在所述警告跟踪中断待决条件,进入所述开始解释执行退出同步循环。Based on the determination that the warning tracking interruption pending condition exists, the process enters the "start interpretation execution exit synchronization loop" state. 4.如权利要求3所述的方法,其中基于确定存在所述警告跟踪中断待决条件进入所述开始解释执行退出同步循环,而不呈现警告跟踪中断并且不用信号通知所述剩余线程中的每一者。4. The method of claim 3, wherein the start of interpretation execution exits the synchronization loop based on determining the existence of the warning trace interruption pending condition, without presenting the warning trace interruption and without signaling each of the remaining threads. 5.如权利要求1所述的方法,其中所述第一线程是所述多个线程中的主线程。5. The method of claim 1, wherein the first thread is the main thread among the plurality of threads. 6.一种在处理器的计算机处理器核心上执行多个线程的系统,所述多个线程包括第一线程和一组剩余线程,所述系统包括所述处理器和存储器:6. A system for executing multiple threads on a computer processor core, the multiple threads including a first thread and a set of remaining threads, the system including the processor and memory: 所述处理器被配置为:The processor is configured to: 确定存在开始解释执行退出条件;It has been determined that an exit condition for initiating interpretation and execution exists; 确定所述计算机处理器核心在宽限期内;It was determined that the computer processor core was within the grace period; 所述第一线程进入开始解释执行退出同步循环而不用信号通知所述一组剩余线程中的任一者;The first thread enters the process of interpreting and executing before exiting the synchronization loop without notifying any of the remaining threads in the group. 所述第一线程保持处于所述开始解释执行退出同步循环,直至所述宽限期到期或者所述剩余线程中的每一者进入对应的开始解释执行退出同步循环;The first thread remains in the start-interpretation-execution-exit synchronization loop until the grace period expires or each of the remaining threads enters the corresponding start-interpretation-execution-exit synchronization loop. 确定对于所述计算机处理器核心,所述宽限期已到期;以及It has been determined that the grace period for the computer processor core has expired; and 基于所述宽限期的到期,由所述第一线程用信号通知所述剩余线程中的每一者进行至所述对应的开始解释执行退出同步循环。Upon the expiration of the grace period, the first thread signals each of the remaining threads to proceed to the corresponding start of interpretation execution and exit the synchronization loop. 7.如权利要求6所述的系统,所述处理器进一步被配置为:7. The system of claim 6, wherein the processor is further configured to: 确定对于警告跟踪中断,所述第一线程为待决的;It was determined that the first thread was pending in response to the warning tracing interruption; 由所述第一线程将警告跟踪中断待决条件传播至剩余线程中的每一者;以及The first thread propagates the warning trace interruption pending condition to each of the remaining threads; and 由所述第一线程导致所述计算机处理器核心进入所述宽限期。The first thread causes the computer processor core to enter the grace period. 8.如权利要求6所述的系统,所述处理器进一步被配置为:8. The system of claim 6, wherein the processor is further configured to: 确定对于所述第一线程,等待状态为待决的;It is determined that for the first thread, the waiting state is pending; 确定对于所述第一线程,存在警告跟踪中断待决条件;以及It was determined that for the first thread, a warning tracing interruption pending condition existed; and 基于确定存在所述警告跟踪中断待决条件,进入所述开始解释执行退出同步循环。Based on the determination that the warning tracking interruption pending condition exists, the process enters the "start interpretation execution exit synchronization loop" state. 9.如权利要求8所述的系统,其中基于确定存在所述警告跟踪中断待决条件进入所述开始解释执行退出同步循环,而不呈现警告跟踪中断并且不用信号通知所述剩余线程中的每一者。9. The system of claim 8, wherein the start of interpretation execution exits the synchronization loop based on determining the existence of the warning trace interruption pending condition, without presenting the warning trace interruption and without signaling each of the remaining threads. 10.如权利要求6所述的系统,其中所述第一线程是所述多个线程中的主线程。10. The system of claim 6, wherein the first thread is the main thread among the plurality of threads. 11.一种计算机可读存储介质,所述计算机可读存储介质具有包含在其上的用于在处理器的计算机处理器核心上执行多个线程的程序指令,所述多个线程包括第一线程和一组剩余线程,所述程序指令能够由所述处理器执行以导致所述处理器:11. A computer-readable storage medium having program instructions contained thereon for executing a plurality of threads on a computer processor core of a processor, the plurality of threads including a first thread and a set of remaining threads, the program instructions being executable by the processor to cause the processor to: 确定存在开始解释执行退出条件;It has been determined that an exit condition for initiating interpretation and execution exists; 确定所述计算机处理器核心在宽限期内;It was determined that the computer processor core was within the grace period; 所述第一线程进入开始解释执行退出同步循环而不用信号通知所述一组剩余线程中的任一者;The first thread enters the process of interpreting and executing before exiting the synchronization loop without notifying any of the remaining threads in the group. 所述第一线程保持处于所述开始解释执行退出同步循环,直至所述宽限期到期或者所述剩余线程中的每一者进入对应的开始解释执行退出同步循环;The first thread remains in the start-interpretation-execution-exit synchronization loop until the grace period expires or each of the remaining threads enters the corresponding start-interpretation-execution-exit synchronization loop. 确定对于所述计算机处理器核心,所述宽限期已到期;以及It has been determined that the grace period for the computer processor core has expired; and 基于所述宽限期的到期,由所述第一线程用信号通知所述剩余线程中的每一者进行至所述对应的开始解释执行退出同步循环。Upon the expiration of the grace period, the first thread signals each of the remaining threads to proceed to the corresponding start of interpretation execution and exit the synchronization loop.
HK17111100.5A 2014-10-20 2015-09-14 Method and system for executing multi threads on computer processor core HK1237090B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US14/518,095 2014-10-20

Publications (2)

Publication Number Publication Date
HK1237090A1 HK1237090A1 (en) 2018-04-06
HK1237090B true HK1237090B (en) 2021-03-12

Family

ID=

Similar Documents

Publication Publication Date Title
CN107077373B (en) Method and system for executing multiple threads on computer processor core
US9009716B2 (en) Creating a thread of execution in a computer processor
CN107111578B (en) Efficient interrupt routing for multithreaded processors
US10176002B2 (en) Quiesce handling in multithreaded environments
CN107111483B (en) Instructions that control access to shared registers of a multithreaded processor
CN106796501B (en) Based on the multiple counters of single reference Inspection and maintenance
US11243800B2 (en) Efficient virtual machine memory monitoring with hyper-threading
HK1237090B (en) Method and system for executing multi threads on computer processor core
US10152341B2 (en) Hyper-threading based host-guest communication
HK1237090A1 (en) Method and system for executing multi threads on computer processor core
HK1237089B (en) Efficient interruption routing for a multithreaded processor
HK1237089A1 (en) Efficient interruption routing for a multithreaded processor
JP2007157125A (en) Method, system and program for safely interrupting blocked processing within server
HK1237088B (en) Instructions controlling access to shared registers of a multi-threaded processor