IPC분류정보
국가/구분 |
United States(US) Patent
등록
|
국제특허분류(IPC7판) |
|
출원번호 |
US-0731690
(2000-12-06)
|
발명자
/ 주소 |
|
출원인 / 주소 |
|
대리인 / 주소 |
|
인용정보 |
피인용 횟수 :
95 인용 특허 :
9 |
초록
▼
A method and system for passing messages between threads is provided, in which a sending thread communicates with a receiving thread by passing a reference to the message to a message queue associated with the receiving thread. The reference may be passed without explicitly invoking the inter-proces
A method and system for passing messages between threads is provided, in which a sending thread communicates with a receiving thread by passing a reference to the message to a message queue associated with the receiving thread. The reference may be passed without explicitly invoking the inter-process or inter-thread message passing services of the computer's operating system. The sending thread may also have a message queue associated with it, and the sending thread's queue may include a reference to the receiving thread's queue. The sending thread can use this reference to pass messages to the receiving thread's queue.
대표청구항
▼
I claim: 1. A computer-implemented method for passing a message from a first thread of execution in a process to a second thread of execution in the process, comprising: instantiating a first thread queue for holding messages, the first thread queue being associated with the first thread of executi
I claim: 1. A computer-implemented method for passing a message from a first thread of execution in a process to a second thread of execution in the process, comprising: instantiating a first thread queue for holding messages, the first thread queue being associated with the first thread of execution; obtaining a first address associated with the first thread queue; sending the first address to the second thread of execution, the second thread of execution being configured to create a second thread queue, to obtain a second address associated with the second thread queue, and to store the first address; receiving the second address from the second thread in response to sending the first address; creating the message at the first thread of execution in the process; obtaining a reference associated with the message; placing the reference into the second thread queue, wherein the reference is usable by the second thread of execution to access the message. 2. The computer-implemented method of claim 1, wherein placing the reference comprises placing the reference into the second thread queue based on the second address. 3. The computer-implemented method of claim 1, further comprising sending another message from the second thread to the first thread based on the first address. 4. The computer-implemented method of claim 1 further comprising: sending a signal to the second thread of execution to indicate that the message has been sent to the second thread of execution. 5. The computer-implemented method of claim 4, wherein the signal is sent via a platform-independent object. 6. The computer-implemented method of claim 1, wherein creating the message comprises: defining a message object for holding the message; and inserting the message into the message object. 7. A method for passing intraprocess messages between scripting threads in a process residing in a computer, the method comprising: creating a first scripting thread of execution; creating a first thread queue for the first scripting thread; obtaining a first address associated with the first thread queue; creating a second scripting thread of execution; passing, to the second scripting thread, the first address for use by the second scripting thread to send messages to the first scripting thread; creating a second thread queue for the second scripting thread; obtaining a second address associated with the second thread queue; and passing, to the first scripting thread, the second address for use by the first scripting thread to send messages to the second scripting thread. 8. The method of claim 7 further comprising: creating a message object; inserting the message from the first scripting thread into the message object; obtaining reference to the message object; and placing the reference into the second thread queue so that the second scripting thread can access the message. 9. The method of claim 8 further comprising: sending a signal from the first scripting thread to the second scripting thread to indicate to the second scripting thread that the message has been sent to the second scripting thread. 10. The method of claim 8, wherein in response to the message further comprising: inserting a flag in the message object to indicate that the message object is being responded to; and placing a reference to the message object into the first thread queue. 11. A method for compiling a program having a plurality of sections, the method comprising: creating one of a plurality of scripting threads for each section of the program, each scripting threads executes an associated script for compiling the associated section, wherein each script is independent of the program; creating a control thread to asynchronously communicate with each of the plurality of scripting threads so that commands can be issued from the control thread to the plurality of scripting threads in parallel, wherein asynchronously communicating with each of the plurality of scripting threads via a plurality of message queues, each scripting thread being associated with a scripting thread queue of the plurality of message queues and the control thread being associated with at least one control thread queue of the plurality of message queues, thereby resolving interdependencies among different sections of the program that are being compiled; providing the control thread a reference to each scripting thread queue; providing each scripting thread a reference to a corresponding control thread queue of the plurality of control thread queues, thereby enabling the control thread to put at least one message in each scripting thread queue and each scripting thread to put a response message in its corresponding control thread queue; and interpreting each script using a script engine, the script engine having an inter-thread signaling mechanism, wherein the control thread uses the signaling mechanism to alert one of the plurality of scripting threads whenever the control thread has sent a message to the one scripting thread. 12. The method of claim 11 further comprising: at the control thread, sending updates to a user interface; and processing commands from the user interface in parallel with asynchronously sending commands to the scripting threads. 13. A system for compiling a program having a plurality of sections, the system comprising: a computer; a plurality of scripts, each script for compiling one section of the program, wherein each script is independent of the program; a plurality of scripting threads executing on the computer, each scripting thread being associated with one of the plurality of scripts, wherein each section of the program is compiled under the direction of the associated script executed by the associated scripting thread; a control thread executing on the computer for coordinating the activity of the plurality of scripting threads by communicating asynchronously with the plurality of scripting threads via a plurality of message queues, thereby resolving interdependencies among different sections of the program that are being compiled, wherein the control thread is associated with one or more control thread queues of the plurality of message queues and each scripting thread is associated with a scripting thread queue of the plurality of message queues, the control thread has a reference to each scripting thread queue; each scripting thread has a reference to a corresponding control thread queue of the plurality of control thread queues, thereby enabling the control thread to put one or more of the messages in each scripting thread queue and each scripting thread to put a response messages in its corresponding control thread queue; and a script engine executing on the computer to interpret the script, the script engine having an inter-thread signaling mechanism, wherein the control thread uses the signaling mechanism to alert one of the scripting threads whenever the control thread has sent a message to the one scripting thread. 14. The system of claim 13, wherein communicating asynchronously occurs via an interface of a cross-platform object. 15. The system of claim 13, wherein the computer is a first computer, the system further comprising: at least one second computer in communication with the first computer, wherein at least one of the scripting threads executes on the second computer. 16. The system of claim 15 further comprising: a network link for enabling the first and second computers to communicate with one another; a means for allowing the scripting thread executing on the second computer to communicate across the network link with the control thread executing on the first computer. 17. The system of claim 13 further comprising: a user interface, wherein the control thread is operable to update the user interface without having to wait for the scripting threads to act on messages sent to them by the control thread. 18. A computer readable storage medium having computer executable instructions; the computer executable instructions performing a method for passing intraprocess messages between scripting threads in a process, the method comprising: creating a first scripting thread of execution; creating a first thread queue for the first scripting thread; obtaining a first address associated with the first thread queue; creating a second scripting thread of execution; passing, to the second scripting thread, the first address for use by the second scripting thread to send messages to the first scripting thread; creating a second thread queue for the second scripting thread; obtaining a second address associated with the second thread queue; and passing, to the first scripting thread, the second address for use by the first scripting thread to send messages to the second scripting thread. 19. The computer readable storage medium of 18, further comprising: creating a message object; inserting the message from the first scripting thread into the message object; obtaining a reference to the message object; and placing the reference into the second thread queue so that the second scripting thread can access the message. 20. The computer readable storage medium of 18, further comprising: sending a signal from the first scripting thread to the second scripting thread to indicate to the second scripting thread that the message has been sent to the sent to the second scripting thread. 21. The computer readable storage medium of 18, further comprising: inserting a flag in the message object to indicate that the message object is being responded to; and placing a reference to the message object into the first thread queue.
※ AI-Helper는 부적절한 답변을 할 수 있습니다.