EP1700212A2 - Visual and graphical data processing using a multi-threaded architecture - Google Patents
Visual and graphical data processing using a multi-threaded architectureInfo
- Publication number
- EP1700212A2 EP1700212A2 EP04815401A EP04815401A EP1700212A2 EP 1700212 A2 EP1700212 A2 EP 1700212A2 EP 04815401 A EP04815401 A EP 04815401A EP 04815401 A EP04815401 A EP 04815401A EP 1700212 A2 EP1700212 A2 EP 1700212A2
- Authority
- EP
- European Patent Office
- Prior art keywords
- thread
- instructions
- semaphore
- graphical element
- execution
- Prior art date
- Legal status (The legal status 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 status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F9/526—Mutual exclusion algorithms
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3004—Arrangements for executing specific machine instructions to perform operations on memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30076—Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
- G06F9/30087—Synchronisation or serialisation instructions
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
Definitions
- the invention relates to visual and graphical data processing. More particularly, the invention relates to use of active semaphore mechanisms to perform visual and graphical data processing operations.
- a "semaphore” (also referred to as “critical sections” or “mutex”) is a hardware and software construct that allows coordination or synchronization of operations in which multiple processes compete for shared resources (e.g., memory, files).
- shared resources e.g., memory, files.
- a semaphore is a value that is stored in a designated location in operating system memory that processes can check and change. Based on the value of the semaphore, a process can either access the shared resource or wait for a period of time and check the semaphore again.
- Semaphores in conventional computer systems are typically implemented as software routines using hardware support of atomic "test and set” or similar types of instructions (e.g., lock, bit test, bit test and set, bit test and reset).
- a producer-consumer communication relationship can be established through shared (e.g., global) data and one or more semaphores.
- shared e.g., global
- semaphores e.g., shared data and one or more semaphores.
- the semaphore allows shared data to be modified by a selected one of multiple processes that are attempting to modify the data, which provides data consistency.
- This semaphore construct is "passive" because threads must perform polling operations to acquire a semaphore.
- the polling requirement consumes processor and system resources that could otherwise be used for other purposes. Therefore, traditional semaphores can result in inefficiencies.
- Figure 1 is a block diagram of one embodiment of a massively multithreaded processor architecture.
- Figures 2a-2d are conceptual illustrations of dependencies in which semaphores can be used to synchronize thread execution.
- Figure 3 is a simple example scene in which rays are traced from a light source to a viewer.
- Figure 4 is a flow diagram of one embodiment of ray tracing using active semaphores.
- Figure 5 is a flow diagram of one embodiment of Z-buffer-based three-dimensional graphics rendering using proactive ordered semaphores.
- Figure 6 is a flow diagram of one embodiment of video decoding using active and or proactive semaphores.
- Described herein is an architecture and associated methods in which multiple parallel passive threads of instructions (hereinafter referred to as "threads") coordinate access to shared resources using "active" semaphores.
- the semaphores are referred to as active because the semaphore entity sends messages to execution and/or control circuitry to cause the state of a thread to change.
- a thread can be placed in a sleep (or inactive) mode by a thread scheduler in response to an unresolved dependency, which can be indicated by a semaphore.
- a thread state variable corresponding to the dependency is used to indicate that the thread is in sleep mode.
- a message is passed to control circuitry (e.g., the thread scheduler) causing the dependency variable to be cleared.
- the thread is placed in an active (or wake) state. Execution can proceed on the threads in the active state.
- control circuitry e.g., the thread scheduler
- the thread is placed in an active (or wake) state. Execution can proceed on the threads in the active state.
- a thread attempts to acquire a semaphore and cannot, that thread is placed in an inactive state. Because the thread is inactive, it cannot poll the semaphore to determine when the dependency indicated by the semaphore is resolved, as is required in the prior art.
- the thread remains in the inactive state until a message is received (e.g., from the semaphore entity) indicating that the dependency has been resolved. In response to the message, the thread is placed in the active state, which allows execution to proceed.
- FIG. 1 is a block diagram of one embodiment of a massively multithreaded processor architecture.
- massively multithreaded refers to an architecture that includes multiple processors that can support multi-threaded execution.
- each processor may support one or multiple threads.
- Multi-threading on a single processor achieves high execution efficiency by allowing active threads to be executed while other threads are in inactive state.
- a thread in the inactive state pending on a semaphore does not consume/waste processor resources.
- the semaphore constructs and associated methods are applicable to any multithreaded architecture regardless of the number of threads supported.
- Massively multi-threaded system 100 includes memory hierarchy 110 that stores data and instruction to be used during execution by one or more processing cores.
- Memory hierarchy 110 may include dynamic random access memory (DRAM), one or many levels of instruction caches, one or many levels of data caches, and/or one or many levels of shared instruction and data caches in any manner known in the art.
- Thread dispatcher 120 is coupled with memory hierarchy 110, receives information such as instruction pointer and data and/or data pointer associated with a new thread. Thread dispatcher 120 also coupled with the processing cores via message bus 125. In one embodiment, thread dispatcher 120 is responsible of managing the thread resources of the processing cores.
- thread dispatcher 120 Upon receiving a new pending thread, thread dispatcher 120 selects one processing core that has the resource to execute the pending thread and dispatches the thread onto the selected processing core. Upon the completion of an existing thread on a processing core, thread dispatcher 120 is informed, consequently, making the thread resource on the processing core available for future pending threads.
- System 100 is illustrated with multiple processor cores (130, 131, 139, 150, 151 and 159), each of which include execution circuits with associated control circuitry.
- the processor cores can be identical or the processor cores can have varying functionality. Any number of processor cores can be included in system 100.
- the processor cores are configured in rows, each row having a row controller.
- row controller 140 can be coupled with processor cores 130, 131 and 139 via row control bus 145.
- row controller 160 can be coupled with processor cores 150, 151 and 159 via row control bus 165.
- the processor cores are also coupled with semaphore entity 170 via message bus 125.
- Semaphore entity 170 includes memory and control logic to provide semaphore functionality as described herein.
- semaphore entity 170 interacts with the processor cores by transmitting and receiving messages as described in greater detail below.
- Thread dispatcher 120 is also coupled with semaphore entity 170 via message bus 125.
- thread dispatcher interacts with semaphore entity 170 on behalf of a thread by transmitting and receiving messages as described in greater detail below.
- Control circuitry in each processing core may contain thread scheduling circuitry to manage the state of multiple threads executing on the same processing core and may also contain instruction scheduling circuitry to execute an active thread of instructions.
- one or more of the processing cores will attempt to access shared system resources.
- a thread through the corresponding execution core, must gain control of a semaphore corresponding to the shared system resource to be accessed.
- the requesting processing core in order to gain control of a semaphore, the requesting processing core sends a semaphore request message to semaphore entity 170 over message bus 125.
- semaphore entity 170 determines whether to grant control of the semaphore to the requesting thread. When the semaphore is granted, semaphore entity 170 sends a semaphore acknowledge message to the requesting thread. In response to the semaphore acknowledge message, the requesting thread is restored to an active state in which execution using the requested resource continues. When the thread has completed use of the shared resource, the thread sends a release semaphore message to semaphore entity 170. In response to the release semaphore message, semaphore entity 170 releases the semaphore and allows other threads to gain access to the system resource.
- semaphore entity 170 determines whether to grant control of the semaphore to the requesting thread. When the semaphore is granted, semaphore entity 170 sends a semaphore acknowledge message to the requesting thread. In response to the semaphore acknowledge message, the requesting thread is restored to an active state in
- semaphores are supported by instractions (semaphore instructions) that are executed by a processing core as well as messages (semaphore messages) that are passed between processing cores and semaphore entity over, for example, a message bus 125.
- instractions semaphore instructions
- messages semaphore messages
- semaphore entity Based on a Linked List
- each semaphore can be a head pointer to a linked list formed from entries in the buffer pool.
- the linked list can be either a bi-directional linked list or a unidirectional linked Ust.
- a semaphore table includes a pointer for each semaphore supported.
- the pointers in the semaphore table are head pointers that indicate a head of a linked list to be used for the corresponding semaphore.
- a free pool pointer indicates the head of buffer pool and unused semaphore entries include a NULL pointer.
- each semaphore entry includes a released-state field, an ack-suppression field, a thread identifier field, a previous pointer and a next pointer. In alternate embodiments, other and/or different fields can be used, for example, the previous pointer can be omitted.
- each semaphore can also include a single bit (or other indicator) to indicate whether the linked list corresponding to the semaphore is empty.
- An Acquire Semaphore Message (ACQ_MSG) is used for a thread, or a thread dispatcher on behalf of a thread, to make a request to the semaphore entity for ownership of a semaphore.
- the ACQ_MSG contains a semaphore identifier field, a thread identifier field, an "auto-release” field and an "acknowledge-suppression” (ack-suppression) field.
- the auto- release field is used for a thread with only a head dependency. That is, the thread depends on previous threads, but no subsequent threads depend on the thread.
- the ack-suppression field is used for a thread with only a tail dependency.
- the ACQ_MSG can be issued by a thread dispatcher or other control circuitry associated with the thread.
- the semaphore entity upon receiving the ACQ_MSG the semaphore entity enqueues the semaphore entry for the request thread to a linked Ust of the target semaphore by removing the head entry from a free pool list and adding it to the tail of the selected semaphore.
- the fields of the semaphore entry are updated based on the information in the ACQJMSG: the thread identifier field, the release-state field and the ack-suppression field are replaced by the requester's thread identifier, the auto-release field and the ack-suppression field in the ACQJMSG. If the semaphore linked Ust is not empty before the ACQ_MSG no message is sent by the semaphore entity. Otherwise, if the semaphore linked Ust is empty before the ACQ_MSG is received one of the following actions is taken.
- the ack-suppression field is not set an ACK_MSG with the thread identifier is sent from the semaphore entity on the message bus 125 to the requesting thread. If the ack-suppression field is set no ACK_MSG is sent from the semaphore entity. If the auto-release field is not set, the just-enqueued semaphore entry is maintained in the semaphore linked list. If the auto-release field is set the just-enqueued semaphore entry is removed from the semaphore linked Ust.
- a Release Semaphore Message is used for a thread to make a request to the semaphore entity to free ownership of a semaphore.
- the REL MSG includes a semaphore identifier field and a thread identifier field.
- the REL_MSG can only be issued by control circuitry associated with a thread holding ownership of the semaphore, i.e., the thread identifier is at the top of the semaphore linked Ust.
- REL_MSG the semaphore entity removes the entry from the head of the semaphore linked list.
- the REL_MSG can be issued by control circuitry associated with any thread sharing the semaphore. Upon receiving the
- REL_MSG the semaphore entity unsets the release-state field to the corresponding entry in the semaphore linked Ust regardless of the position of the entry in the linked Ust. If semaphore entry is at the head of the linked list, the entry is removed from the head of the semaphore linked list. The next entry is then becoming the head of the linked Ust. If the next entry is not NULL, it will be examined. If the new head of the linked Ust has the release-state field set, it is again removed from the head of the semaphore linked list.
- this recursive process continues until either the head of the linked list is NULL (the semaphore queue is empty) or the head of the linked list has the released-state field unset (waiting for the release of the semaphore from the thread corresponding to the entry). If the head of the linked Ust is not NULL and the ack-suppression field is not set, an ACK MSG is sent by the semaphore entity to the thread identified by the entry's thread identifier field. If the head of the linked list is not NULL and the ack-suppression field is set, no ACK_MSG is sent.
- the Semaphore Acknowledgement Message (ACKJMSG) is generated by the semaphore entity to notify a thread that the requested semaphore has been acquired.
- the ACK MSG includes a semaphore identifier field and a thread identifier field.
- the ACK_MSG is issued only by the semaphore entity and received by the processing core executing the thread identified by in the thread identifier field.
- the receiving processing core Upon receiving the ACK_MSG the receiving processing core unsets the wait-semaphore state variable of the thread identified by the thread identifier field. If the thread is in an inactive state, the thread state is changed to an active state.
- An Acquire Semaphore (ACS) instruction causes an ACQJMSG message to be sent to the semaphore entity with a semaphore identifier of the requested semaphore, the thread identifier of the requesting thread and with the auto-release field unset. The thread is put in an inactive state with the wait- semaphore state field set.
- the ACS instruction is paired with (followed by) a Release Semaphore (RLS) instruction (described below).
- RLS Release Semaphore
- An Acquire Semaphore with Auto-Release (ASR) instruction causes an ACQJMSG to be sent to the semaphore entity with a semaphore identifier for the requested semaphore, a thread identifier of the requesting thread and with the auto-release field set.
- the thread is put in an inactive state with the wait- semaphore state field set.
- the ASR instruction cannot be paired with the RLS instruction.
- the ASR instruction is used for threads with only a head dependency.
- a Wait Semaphore (WTS) instruction causes the wait-semaphore thread state to be checked. If the state is set the thread is put in the inactive state. If the state is not set the thread remains in the active state. No message is sent to the semaphore entity in response to a WTS instruction. Use of the WTS instruction impUes that the semaphore was acquired previously by the thread dispatcher using the ACQ_MSG on behalf of the thread at the thread dispatch time. The WTS instruction is not used if the ack-suppression field is set in the ACQ_MSG previously issued by the thread dispatcher.
- a Release Semaphore (RLS) instruction causes a RELJMSG to be sent to the semaphore entity with a semaphore identifier for the semaphore being released and a thread identifier for the releasing thread.
- the releasing thread remains in the active state. If an ACS instruction has been previously issued for the releasing thread only one RLS instruction is issued. If an ASR instruction has been previously issued for the releasing thread no RLS instruction is issued. If a WTS instruction has been issued for the releasing thread, the WTS instruction may or may not be followed by a RLS instruction depending on the auto-release field of the ACQ_MSG sent by the thread dispatcher. If the auto-release field is unset, no RLS instruction is issued. If the auto-release field is set a RLS instruction foUows the WTS instruction.
- a thread of instructions As a thread of instructions is executed by a processor, the instructions are executed when resources are available. When a resource having a semaphore is required, for example, a shared memory location, ownership of a semaphore may be required to access the resource. Thus, execution of the thread of instructions is accomplished in any manner known in the art until a semaphore is needed.
- an Acquire Semaphore (ACS) instruction is executed.
- the ACS instruction can be executed by the processor executing the thread of instructions requesting the semaphore.
- an Acquire Semaphore Message (ACQJMSG) is transmitted to the semaphore entity by the processing core executing the thread over the message bus.
- ACQ_MSG Acquire Semaphore Message
- One format for the ACQ_MSG is described above. Other formats can also be used.
- processor resources and system bandwidth are not consumed by the thread polling the semaphore.
- the processor resources and system bandwidth can be used by other active threads.
- the semaphore entity receives the ACQ_MSG and places the requester information entry in the linked list of the target semaphore. If the semaphore is not owned or controlled by another thread, the semaphore entry is placed at the head of the semaphore linked Ust because there are no other entries. If the semaphore is owned or controlled by another thread, the semaphore entry is placed at the tail of the semaphore linked Ust. In one embodiment, the tail of the hriked list is identified by traversing the linked list entries in the buffer pool from a head entry to a tail entry and the new entry becomes the new tail entry.
- the tail of the linked Ust is directly identified by the tail pointer of the linked list stored in the semaphore table.
- ACK_MSG acknowledgement message
- the corresponding thread In response to the ACKJMSG the corresponding thread is activated. When activated, processing of instructions in the thread resumes and the shared resource corresponding to the semaphore can be accessed. When the thread has completed access to the shared resource the semaphore is released, which is described in greater detail below.
- a semaphore is released when a Release Semaphore (RLS) instruction is executed.
- the RLS instruction can be executed by the processor executing the thread of instructions requesting the semaphore.
- a Release Semaphore Message (REL_MSG) is transmitted to the semaphore entity.
- REL_MSG Release Semaphore Message
- One format for the REL_MSG is described above. Other formats can also be used.
- the semaphore entity matches the thread identifier field of the REL_MSG with the semaphore linked list.
- the semaphore entity removes the thread entry from head of the linked Ust. The subsequent entry in the linked Ust becomes the head entry. The semaphore can then be granted to the thread corresponding to the new head entry. If the corresponding semaphore entry is not at the head of the linked list, the semaphore entity set the release-state field of the semaphore entry.
- semaphores can be classified as associative semaphores or ordered semaphores. Based on the transmission of the ACK_MSG from the semaphore entity, semaphores can be classified as active semaphores or as proactive semaphores. Thus, four types of semaphores can be supported.
- An associative semaphore allows concurrent threads to access the semaphore in any order.
- a semaphore is initialized by the thread dispatcher at the beginning of a session with a NULL linked Ust (or a single bit to indicate an empty linked list). No other message is sent from the thread dispatcher to the semaphore entity.
- the semaphore linked list is built on the fly by the execution circuitry executing the multiple threads of instructions.
- a thread makes a request for an associative semaphore by executing an ACS or an ASR instruction.
- the thread releases an associative semaphore by executing a RLS. instruction.
- a new ACQJMSG will result in an entry corresponding to the requesting thread being placed at the tail of the semaphore linked list.
- FCFS first-come, first-served
- An ordered semaphore allows concurrent threads to access the semaphore in a predetermined order.
- the order is predetermined by the thread dispatcher at the time of dispatching.
- the order can be appUcation dependent.
- the thread dispatcher may send an ACQJMSG on behalf of each dispatched thread to the semaphore entity to build the semaphore linked Ust according to. that order.
- a thread entering a critical section may use the WTS instruction to wait for ownership of the semaphore.
- the ACS and ASR instructions are not used as the thread will have already been placed in the semaphore linked Ust.
- the semaphore entity can only provide control of the semaphore according to the Uriked list order. Threads waiting on the semaphore will receive the ACQ_MSG in the linked list order.
- the ACQJMSG is used to cause a transition of a thread from an inactive state to an active state.
- the semaphore entity receives one or many ACQJMSGs from execution circuitry executing threads.
- the semaphore entity only transmits one ACK_MSG to the execution circuitry corresponding to the thread at the head of the semaphore linked list.
- the semaphore entity examines the state of the new head of the linked list, and may transmit subsequent ACK_MSG to the execution circuitry corresponding to the thread of the new head of semaphore linked list.
- An active semaphore can also be an associative semaphore.
- a proactive semaphore transmits one and only one ACKJMSG to the thread at the head of the semaphore linked Ust whether or not the thread is in the inactive state. This applies to threads using ordered semaphores with ACQ_MSG sent previously by the thread dispatcher so that only one ACK_MSG sent to a thread.
- a thread using an ordered semaphore may contain a WTS and/or a RLS instruction.
- the ACKJMSG is sent automatically by the semaphore entity to the thread at the head of the semaphore linked list.
- a "risk condition" that may exist if the timing of an entry from a thread is enqueued in the semaphore linked list by the thread dispatcher and the time the thread is visible to the execution circuitry. Because both actions are initiated by the thread dispatcher, but occur through different data paths, the timing of these events must be considered.
- the wait- semaphore thread state variable is set by the thread dispatcher, even if the WTS instruction of the thread is reached before the thread is enqueued to the semaphore linked list the risk condition will not occur.
- the WTS instruction causes the thread to enter the inactive state without sending a message to the semaphore entity.
- the execution circuitry causes the thread to be active again.
- the semaphore is configured by the thread dispatcher with the ack- suppression field set a risk condition may result. In this case, the thread will not be placed in the inactive state.
- the thread dispatcher completes thread configuration before completion of semaphore configuration if the ack-suppression is not set.
- the thread dispatcher completes semaphore configuration before completion of thread configuration if the ack- suppression field is set.
- the thread dispatcher can dispatch a thread and wait for a signal that indicates that thread configuration is complete before sending a message to cause configuration of the semaphore.
- the thread dispatcher can send a message to initiate configuration of the semaphore and wait for a signal that indicates that the semaphore configuration is complete before dispatching the thread. Because serial configurations can unnecessarily limit the throughput from the dispatcher, the configuration operations can be pipelined.
- Figures 2a-2d are conceptual illustrations of dependencies in which semaphores can be used to synchronize thread execution.
- Figure 2a illustrates a 1:1:1 (one on one) dependency.
- the dependency of Figure 2a can be a strong sequential order dependency or an associative dependency.
- a strong sequential order dependency a single proactive, ordered semaphore can be used.
- the ack-suppression field and the auto-release field are both unset.
- the thread of instructions includes a WTS-RLS instruction pair to obtain and release the semaphore.
- a single active, associative semaphore can be used.
- the ack- suppression field and the auto-release field are both unset.
- the thread of instructions includes an ACS-RLS instruction pair to obtain and release the semaphore.
- Figure 2b illustrates a 1 :N (one on many) dependency, where one thread has head dependency on N other threads where the N other threads do not depend on each other.
- N is a positive integer number that can be one or greater than one.
- a single proactive, ordered semaphore can be used.
- ACQ_MSGs are sent by the thread dispatcher on behave of the N threads.
- the ack-suppression field is set and the auto-release field is unset.
- an ACQJMSG is also sent by the thread dispatcher.
- the ack-suppression field is unset and the auto-release field is set.
- the N threads of instructions include only an RLS instruction to release the semaphore.
- the single thread of instructions includes a WTS-RLS instruction pair to obtain and release the semaphore.
- Figure 2c illustrates a N: 1 (many on one) dependency, where N threads have head dependency on a single thread but the N threads do not depend on each other.
- a single proactive, ordered semaphore can be used.
- the thread dispatcher is responsible of sending ACQ_MSG on behave of both the N depending threads and the one dependent thread.
- the ack-suppression field is set and the auto-release field is unset.
- the ack-suppression field is unset and the auto-release field is set.
- the single dependent thread of instructions includes only an RLS instruction to release the semaphore.
- the N depending threads of instructions include a WTS- RLS instruction pair to obtain and release the semaphore.
- Figure 2d illustrates a N:M (many on many) dependency, where N depending threads have head dependency on M dependent threads.
- N:M dependency case is a more general case comparing to the 1 : 1 : 1 , 1 :N and N: 1 cases described above.
- a single proactive, ordered semaphore can be used.
- the thread dispatcher is responsible of sending ACQ_MSGs on behave of both the N depending threads and the M dependent threads.
- the ack-suppression field is set and the auto-release field is unset.
- the ack- suppression field is unset and the auto-release field is set.
- the M dependent threads of instructions include only an RLS instruction to release the semaphore.
- the N depending threads of instructions include a WTS-RLS instruction pair to obtain and release the semaphore.
- the dependencies of Figures 2a-2d can be used to support more complex dependencies.
- a N: 1 :N dependency two proactive, ordered semaphores are used.
- the N:l dependency is processed as described above with respect to Figure 2c and the 1 :N dependency is processed as described above with respect to Figure 2b.
- the semaphore mechanisms and the thread synchronization techniques described above can be appUed to many operations performed in a computer or similar electronic system.
- various graphical processing techniques can be performed using the semaphore constructs described herein. While the graphical processing techniques provide useful examples for use of active and proactive semaphores, use of these semaphore mechanisms is not limited to graphical data processing.
- Ray tracing is a technique for rendering three-dimensional graphics and can support complex light interactions such as mirrors, transparent surfaces, shadows, etc.
- ray tracing is based on modeling reflection and refraction by recursively following (tracing) a path that a ray of light takes at the ray bounces through a scene.
- a trace of a ray between two bounces (or between the screen position to the first bounce or between a screen position or a bounce to the light source) is referred to as a ray segment.
- the viewing perspective e.g., a camera
- the color is determined for each pixel.
- Various techniques for ray tracing are known in the art. See, for example, Cook, R.L. and Torrance, K.E., "A Reflectance Model for Computer
- an image screen can be rendered by with starting the eye rays on each screen position.
- a screen position is also referred to as destination pixel.
- Each eye ray will traverse the three-dimensional scene space and generate one or many ray segments due to the reflection and refraction interaction with the objects in the scene.
- Ray segments associated with different destination pixels are independent of each other. The processing of ray segments associated with different destination pixels can be computed in parallel without modifying shared resource and therefore without using semaphore mechanism.
- the ray tracing problem can fit well on a massively multi-threaded computing architecture.
- a single destination pixel there may be multiple ray segments.
- the final color can be determined as a weighted sum of each ray segment associated with the pixel.
- the update of a pixel's final color which is a shared resource for the threads associated with the same pixel, requires the use of a semaphore mechanism.
- a N:l dependency mechanism described above can be used for ray tracing.
- the semaphore identifier can be determined by hashing the destination pixel address. If there are fewer semaphores available than independent pixels, some pixels may share a semaphore. This is a performance issue but not a functional problem.
- the semaphores can be used dynamically without global synchronization. Without using semaphores, operations for tracing ray segments associated with a pixel are performed sequentially. Thus, use of semaphores with ray tracing techniques allows for greater parallel processing.
- Figure 3 is a simple example scene in which rays are traced from a
- Ught source to a viewer.
- a large number of rays travel between Ught source 300 and viewer 330; however, only a small number of rays are illustrated in Figure 3 for reasons of simplicity of description.
- Ray 340 travels directly from light source 300 to viewer 330. Because ray 340 is not reflected or refracted, the pixels corresponding to ray 340 are represented by the color of light provided by light source 300. Ray tracing computations for the light corresponding to ray segments 350 and 355 is more complex because the Ught is reflected by object 310.
- ray tracing operations for segments 350 and 355 can be performed in parallel.
- ray tracing operations for segments 350 and 355 can be performed in parallel.
- 355 can be performed as two threads, the results of which are combined to provide the pixel color resulting from the multiple ray tracing operations.
- Coordination of the two threads can be accomplished using active semaphores as described above.
- Figure 4 is a flow diagram of one embodiment of ray tracing using active semaphores.
- the ray paths are determined, 410. Determination of ray paths can be accomplished in any manner known in the art.
- ray tracing operations determine whether multiple ray segments contribute to a single pixel
- a single ray segment contributes to a single pixel, 420, the ray path is traced, 425.
- any ray tracing technique known in the art can be used.
- a pixel color is determined, 475, based on the results of the ray tracing operations. The pixel can then be displayed, printed or otherwise rendered for viewing.
- ray tracing for multiple ray segments in parallel can create a N:l dependency where the pixel result is dependent upon the results of the ray tracing operations for the N ray segments. This N:l dependency is handled as described above.
- the results of the multiple ray tracing operations are accumulated, 450.
- a pixel color is determined, 475, based on the results of the accumulated ray tracing operations. The pixel can then be displayed, printed or otherwise rendered for viewing.
- Z-buffer-based Three-Dimensional Rendering Using Active Semaphores [0079]
- rendered objects are divided into render primitives such as points, lines, triangles, triangle strips, etc.
- the render primitives are projected onto the viewing screen.
- Render primitives projected onto different screen pixels can be rendered independently.
- the Z-buffer is a screen size buffer that, on a pixel-by-pixel basis, stores the Z value of the most recent update to screen pixels. Obscurities are resolved using Z-test.
- the primitive's Z-value is compared with the Z-value stored in the Z-buffer for screen pixel. If the primitive's Z-value is smaller than the Z-buffer value, the destination pixel color is updated with the rendered color from the primitive, and the Z-buffer value is updated as well. If the primitive's Z-value is equal to or greater than the Z-buffer value, the destination pixel color as well as the corresponding Z-buffer value is unchanged.
- the primitives projected onto the same screen pixel must be rendered in the strict order.
- the Z-buffer- based three-dimensional rendering can be realized using multi-threaded processing on a massively threaded architecture.
- independent primitives can be rendered by independent threads.
- Dependencies between the primitives, for example the Z-buffer test and update on a common pixel by multiple primitives, can be resolved using the semaphore mechanisms described above.
- Figure 5 is a flow diagram of one embodiment of Z-buffer-based three-dimensional graphics rendering using proactive ordered semaphores.
- the object(s) to be rendered are segmented into primitives and portions of primitives based on the projections to the viewing screen, 510.
- the semaphores are configured for the primitives or portions of primitives based on the projected screen pixel locations, 520.
- Rendering operations are performed on the primitives or portions of primitives by multiple threads of instructions, 530.
- the threads can be executed by one or more processors and can resolve dependencies using one or more of the semaphore mechanisms described above. For example, three-dimensional rendering for multiple primitives by different threads that are projected onto the same screen pixel can create a 1 : 1 : 1 dependency where the Z-test and destination color update of each thread is dependent upon the results of one or many threads updating the same screen pixel preceding the thread. This 1:1:1 dependency is handled as described above.
- the thread for the given primitive or primitive segment performs Z-test and upon successful Z-test updates the Z-value and color value for the projected pixel, 550.
- a final rendered picture is generated after the primitives are rendered, 560. The final rendered picture can then be displayed, printed or otherwise presented for viewing.
- a picture In some video coding standards, for example MPEG-2, groups of one or more segments (such as macroblocks) within a picture (visual object plane, or VOP) can be decoded by independent threads of instructions.
- VOP visual object plane
- decoding of a picture segment such as a macroblock has dependency of decoding of other picture segments. Therefore, a picture can be decoded by multiple threads of instructions on a multi-threaded architecture. Dependencies between the threads can be resolved using the semaphore mechanisms described above.
- FIG. 6 is a flow diagram of one embodiment of video decoding using active and/or proactive semaphores. The flow diagram depicts the decoding process of one picture of a video sequence. The same process can be repeated to decode multiple pictures of a video sequence.
- the segments of a picture to be decoded are determined, 610. The segments can be, for example, blocks, groups of blocks, macroblocks or groups of macroblocks, or any other segmentation of the frame to be decoded.
- inter-segment dependencies are determined before decoding operations are performed on the segments by different threads of instructions. If a segment has head dependency - decoding of the segment depends on the decoding results of other segments, 620, - one or more semaphores with head dependency are configured for the thread of instructions that processes the segment, 625. If a segment has tail-dependency - decoding of the subsequent segments) depends on the decoding results of this segment, 630,
- one or more semaphores with tail dependency are configured for the thread of instructions that processes the segment, 635.
- Decoding operations are performed on the segments by multiple threads of instructions, 640.
- the threads can be executed by one or more processors and can resolve dependencies using one or more of the semaphore mechanisms described above. For example, for a segment that has head dependency on N segments, dependency of these segments can be resolved using a semaphores configured in N: 1 dependency mode.
- the threads of the N dependent segments are configured with semaphores with tail dependencies and the one depending segment is configured with semaphore with a head dependency. This N:l dependency is handled as described above.
- the dependencies of a segment are resolved, 630, the results of the decoded segment are generated, 650.
- a final picture is generated from the aggregated segment results, 660.
- the final decoded picture can then be displayed, printed or otherwise presented for viewing.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multi Processors (AREA)
- Mobile Radio Communication Systems (AREA)
- Image Generation (AREA)
- Executing Machine-Instructions (AREA)
- Digital Computer Display Output (AREA)
Abstract
Description
Claims
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US10/750,589 US8271986B2 (en) | 2003-12-31 | 2003-12-31 | Visual and graphical data processing using a multi-threaded architecture |
| PCT/US2004/043320 WO2005066778A2 (en) | 2003-12-31 | 2004-12-22 | Visual and graphical data processing using a multi-threaded architecture |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| EP1700212A2 true EP1700212A2 (en) | 2006-09-13 |
Family
ID=34749337
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| EP04815401A Withdrawn EP1700212A2 (en) | 2003-12-31 | 2004-12-22 | Visual and graphical data processing using a multi-threaded architecture |
Country Status (7)
| Country | Link |
|---|---|
| US (1) | US8271986B2 (en) |
| EP (1) | EP1700212A2 (en) |
| JP (1) | JP4575925B2 (en) |
| KR (1) | KR20060108741A (en) |
| CN (2) | CN101147126B (en) |
| TW (1) | TWI285851B (en) |
| WO (1) | WO2005066778A2 (en) |
Families Citing this family (20)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006163547A (en) * | 2004-12-03 | 2006-06-22 | Canon Inc | A stereoscopic image generation program, a stereoscopic image generation system, and a stereoscopic image generation apparatus. |
| US7439973B2 (en) * | 2005-08-11 | 2008-10-21 | International Business Machines Corporation | Ray tracing with depth buffered display |
| US20070052704A1 (en) * | 2005-09-08 | 2007-03-08 | Arm Limited | 3D graphics image formation |
| US7965898B2 (en) * | 2005-10-28 | 2011-06-21 | Nvidia Corporation | Accelerating video decoding using multiple processors |
| US9665970B2 (en) * | 2006-09-19 | 2017-05-30 | Imagination Technologies Limited | Variable-sized concurrent grouping for multiprocessing |
| US8018457B2 (en) * | 2006-09-19 | 2011-09-13 | Caustic Graphics, Inc. | Ray tracing system architectures and methods |
| US8121196B2 (en) * | 2006-11-02 | 2012-02-21 | Corel Corporation | Method and apparatus for multi-threaded video decoding |
| US8072454B1 (en) * | 2007-12-13 | 2011-12-06 | Nvidia Corporation | Parallel processing system, method, and computer program product for selecting a ray tracing entity from a group of ray tracing entities for processing |
| US8695002B2 (en) * | 2009-10-20 | 2014-04-08 | Lantiq Deutschland Gmbh | Multi-threaded processors and multi-processor systems comprising shared resources |
| KR101155689B1 (en) * | 2011-04-12 | 2012-06-12 | 고려대학교 산학협력단 | Apparatus and method for estimating distance field based on primitive tree |
| CN103366386A (en) * | 2013-07-14 | 2013-10-23 | 西安电子科技大学 | Parallel image uncompressing system based on multiple processes and multiple threads |
| CN103455356B (en) * | 2013-09-05 | 2017-02-08 | 中国计量学院 | Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device |
| US10977092B2 (en) * | 2015-10-16 | 2021-04-13 | Qualcomm Incorporated | Method for efficient task scheduling in the presence of conflicts |
| US10318348B2 (en) * | 2016-09-23 | 2019-06-11 | Imagination Technologies Limited | Task scheduling in a GPU |
| GB2554392B (en) * | 2016-09-23 | 2019-10-30 | Imagination Tech Ltd | Task scheduling in a GPU |
| KR20180038793A (en) * | 2016-10-07 | 2018-04-17 | 삼성전자주식회사 | Method and apparatus for processing image data |
| US10255717B2 (en) * | 2016-11-01 | 2019-04-09 | Nvidia Corporation | Geometry shadow maps with per-fragment atomics |
| US10614613B2 (en) | 2017-07-28 | 2020-04-07 | Nvidia Corporation | Reducing noise during rendering by performing parallel path space filtering utilizing hashing |
| US10871991B2 (en) * | 2019-01-18 | 2020-12-22 | EMC IP Holding Company LLC | Multi-core processor in storage system executing dedicated polling thread for increased core availability |
| CN114816803B (en) * | 2022-06-28 | 2022-09-23 | 航天宏图信息技术股份有限公司 | Distributed simulation communication message processing method and device |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2003323415A (en) * | 2002-04-26 | 2003-11-14 | Internatl Business Mach Corp <Ibm> | Memory access ordering, method and device for lock management, program, and recording medium |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH03164964A (en) * | 1989-11-24 | 1991-07-16 | Nippon Telegr & Teleph Corp <Ntt> | Exclusive control processor for information processor |
| US6018785A (en) * | 1993-12-30 | 2000-01-25 | Cypress Semiconductor Corp. | Interrupt-generating hardware semaphore |
| US5715459A (en) * | 1994-12-15 | 1998-02-03 | International Business Machines Corporation | Advanced graphics driver architecture |
| US5951672A (en) * | 1997-07-02 | 1999-09-14 | International Business Machines Corporation | Synchronization method for work distribution in a multiprocessor system |
| JP3900621B2 (en) * | 1997-10-16 | 2007-04-04 | ソニー株式会社 | Information processing method and recording medium |
| US6088044A (en) | 1998-05-29 | 2000-07-11 | International Business Machines Corporation | Method for parallelizing software graphics geometry pipeline rendering |
| US6502097B1 (en) * | 1999-12-23 | 2002-12-31 | Microsoft Corporation | Data structure for efficient access to variable-size data objects |
| CA2373707A1 (en) * | 2001-02-28 | 2002-08-28 | Paul Besl | Method and system for processing, compressing, streaming and interactive rendering of 3d color image data |
| CN1212569C (en) * | 2002-11-01 | 2005-07-27 | 英业达股份有限公司 | Multi-threaded automated testing method |
-
2003
- 2003-12-31 US US10/750,589 patent/US8271986B2/en not_active Expired - Fee Related
-
2004
- 2004-12-22 WO PCT/US2004/043320 patent/WO2005066778A2/en not_active Ceased
- 2004-12-22 CN CN2004800348584A patent/CN101147126B/en not_active Expired - Fee Related
- 2004-12-22 JP JP2006547368A patent/JP4575925B2/en not_active Expired - Fee Related
- 2004-12-22 EP EP04815401A patent/EP1700212A2/en not_active Withdrawn
- 2004-12-22 KR KR1020067013046A patent/KR20060108741A/en not_active Ceased
- 2004-12-22 CN CN2011101059282A patent/CN102200927B/en not_active Expired - Fee Related
- 2004-12-24 TW TW093140498A patent/TWI285851B/en not_active IP Right Cessation
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2003323415A (en) * | 2002-04-26 | 2003-11-14 | Internatl Business Mach Corp <Ibm> | Memory access ordering, method and device for lock management, program, and recording medium |
| US20040148475A1 (en) * | 2002-04-26 | 2004-07-29 | Takeshi Ogasawara | Method, apparatus, program and recording medium for memory access serialization and lock management |
Non-Patent Citations (2)
| Title |
|---|
| ANONYMOUS: "Semaphore (programming) - Wikipedia", 20 November 2003 (2003-11-20), XP055413445, Retrieved from the Internet <URL:https://en.wikipedia.org/w/index.php?title=Semaphore_(programming)&oldid=2273557> [retrieved on 20171009] * |
| JUDIT BAR-ILAN ET AL: "Distributed resource allocation algorithms", 2 November 1992, DISTRIBUTED ALGORITHMS, SPRINGER BERLIN HEIDELBERG, BERLIN, HEIDELBERG, PAGE(S) 277 - 291, ISBN: 978-3-540-56188-0, XP019199735 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101147126B (en) | 2011-06-08 |
| CN102200927A (en) | 2011-09-28 |
| US20050198644A1 (en) | 2005-09-08 |
| WO2005066778A3 (en) | 2006-09-28 |
| JP4575925B2 (en) | 2010-11-04 |
| US8271986B2 (en) | 2012-09-18 |
| WO2005066778A2 (en) | 2005-07-21 |
| TW200527325A (en) | 2005-08-16 |
| JP2007517326A (en) | 2007-06-28 |
| CN101147126A (en) | 2008-03-19 |
| CN102200927B (en) | 2013-11-20 |
| KR20060108741A (en) | 2006-10-18 |
| TWI285851B (en) | 2007-08-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8271986B2 (en) | Visual and graphical data processing using a multi-threaded architecture | |
| US12229865B2 (en) | Graphics processor with non-blocking concurrent architecture | |
| US9286119B2 (en) | System, method, and computer program product for management of dependency between tasks | |
| US8368701B2 (en) | Metaprocessor for GPU control and synchronization in a multiprocessor environment | |
| US9442755B2 (en) | System and method for hardware scheduling of indexed barriers | |
| CN110443742B (en) | Data processing system | |
| US20100110089A1 (en) | Multiple GPU Context Synchronization Using Barrier Type Primitives | |
| US20160019066A1 (en) | Execution of divergent threads using a convergence barrier | |
| US8914800B2 (en) | Behavioral model based multi-threaded architecture | |
| CN109213607B (en) | Multithreading rendering method and device | |
| WO2003058431A1 (en) | Methods and system for managing computational resources of a coprocessor in a computing system | |
| US11770215B2 (en) | Transceiver system with end-to-end reliability and ordering protocols | |
| US9536276B2 (en) | Method of submitting graphics workloads and handling dropped workloads | |
| US20250299280A1 (en) | Graphics processors |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PUAI | Public reference made under article 153(3) epc to a published international application that has entered the european phase |
Free format text: ORIGINAL CODE: 0009012 |
|
| 17P | Request for examination filed |
Effective date: 20060407 |
|
| AK | Designated contracting states |
Kind code of ref document: A2 Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IS IT LI LT LU MC NL PL PT RO SE SI SK TR |
|
| AX | Request for extension of the european patent |
Extension state: AL BA HR LV MK YU |
|
| PUAK | Availability of information related to the publication of the international search report |
Free format text: ORIGINAL CODE: 0009015 |
|
| REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 1088413 Country of ref document: HK |
|
| RIC1 | Information provided on ipc code assigned before grant |
Ipc: G06F 9/46 20060101ALI20061019BHEP Ipc: G06F 9/38 20060101AFI20061019BHEP |
|
| DAX | Request for extension of the european patent (deleted) | ||
| 17Q | First examination report despatched |
Effective date: 20070402 |
|
| REG | Reference to a national code |
Ref country code: HK Ref legal event code: WD Ref document number: 1088413 Country of ref document: HK |
|
| STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: THE APPLICATION HAS BEEN WITHDRAWN |
|
| 18W | Application withdrawn |
Effective date: 20180306 |