Synchronizing communication over shared memory
First Claim
1. A method of communicating between a sender thread and a receiving thread through shared memory, the method comprising:
- sending a first message by said sender thread by a polling transmission method comprising;
storing said first message;
changing a transmit index; and
forcing a purge of a second memory pipeline for said sender thread after said changing said transmit index;
receiving said first message by said receiving thread by a polling receiving method comprising;
reading said transmit index to determine that said first message is ready to be read; and
reading said first message;
changing to a synchronization object receiving method by said receiving thread by a first changeover method comprising;
forcing a purge of a first memory pipeline for said receiving thread prior to setting a wait object;
setting said wait object, said wait object being an indicator that said receiving thread is not polling for messages;
transmitting a second message by said sender thread by a synchronization object transmission method comprising;
detecting that said wait object is set;
setting an awake object;
storing said second message; and
changing said transmit index;
determining that no new messages are available; and
changing from a synchronization object receiving method by said receiving thread to said polling transmission method by a second changeover method comprising;
receiving said awake object; and
executing said polling receiving method.
2 Assignments
0 Petitions
Accused Products
Abstract
Two threads may communicate via shared memory using two different modes. In a polling mode, a receiving thread may poll an indicator set by the sending thread to determine if a message is present. In a blocking mode, the receiving thread may wait until a synchronization object is set by the sending thread which may cause the receiving thread to return to the polling mode. The polling mode may have low latency buy may use processor activity of the receiving thread to repetitively check the indictor. The blocking mode may have a higher latency but may allow the receiving thread to enter a sleep mode or perform other activities.
-
Citations
16 Claims
-
1. A method of communicating between a sender thread and a receiving thread through shared memory, the method comprising:
-
sending a first message by said sender thread by a polling transmission method comprising; storing said first message; changing a transmit index; and forcing a purge of a second memory pipeline for said sender thread after said changing said transmit index; receiving said first message by said receiving thread by a polling receiving method comprising; reading said transmit index to determine that said first message is ready to be read; and reading said first message; changing to a synchronization object receiving method by said receiving thread by a first changeover method comprising; forcing a purge of a first memory pipeline for said receiving thread prior to setting a wait object; setting said wait object, said wait object being an indicator that said receiving thread is not polling for messages; transmitting a second message by said sender thread by a synchronization object transmission method comprising; detecting that said wait object is set; setting an awake object; storing said second message; and changing said transmit index; determining that no new messages are available; and changing from a synchronization object receiving method by said receiving thread to said polling transmission method by a second changeover method comprising; receiving said awake object; and executing said polling receiving method. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system comprising:
-
a first thread; a second thread; a shared memory capable of being accessed by said first thread and said second thread; one of said first thread and said second thread being a sender thread and the other of said first thread and said second thread being a receiving thread, said sender thread and said receiving thread being configured to communicate using a method comprising; sending a first message by said sender thread by a polling transmission method comprising; storing said first message in said shared memory; changing a transmit index; and forcing a purge of a second memory pipeline for said sender thread after said changing said transmit index; receiving said first message by said receiving thread by a polling receiving method comprising; reading said transmit index to determine that said first message is ready to be read; and reading said first message from said shared memory; changing to a synchronization object receiving method by said receiving thread by a first changeover method comprising; forcing a purge of a first memory pipeline for said receiving thread prior to setting a wait object; setting said wait object, said wait object being an indicator that said receiving thread is not polling for messages; transmitting a second message by said sender thread by a synchronization object transmission method comprising; detecting that said wait object is set; setting an awake object; storing said second message in said shared memory; and changing said transmit index; determining that no new messages are available; and changing from a synchronization object receiving method by said receiving thread to said polling transmission method by a second changeover method comprising; receiving said awake object; and executing said polling receiving method. - View Dependent Claims (10, 11, 12, 13, 14, 15)
-
-
16. A method of communicating between a sender thread and a receiving thread through shared memory, the method comprising:
-
sending a first message by said sender thread by a polling transmission method comprising; storing said first message in said shared memory; storing a pointer to said first message in a first register of a first buffer; changing a transmit index to indicate said first register of said first buffer; and purging a memory pipeline of said sender thread after said changing said transmit index; receiving said first message by said receiving thread by a polling receiving method comprising; reading said transmit index; reading a receive index; comparing said transmit index to said receive index to determine that said transmit index and said receive index are different; incrementing said receive index; reading said first register from said first buffer, said first register corresponding to said receive index; and reading said first message from said shared memory; changing to a synchronization object receiving method by said receiving thread by a first changeover method comprising; forcing a purge of a second memory pipeline for said receiving thread prior to setting a wait object; setting said wait object, said wait object being an indicator that said receiving thread is not polling for messages; transmitting a second message by said sender thread by a synchronization object transmission method comprising; detecting that said wait object is set; setting an awake object; storing said second message in said shared memory; and changing said transmit index; determining that no new messages are available; and changing from a synchronization object receiving method by said receiving thread to said polling transmission method by a second changeover method comprising; receiving said awake object; and executing said polling receiving method.
-
Specification