Re: DO Message queueing issues
Re: DO Message queueing issues
- Subject: Re: DO Message queueing issues
- From: James Bucanek <email@hidden>
- Date: Mon, 24 Jul 2006 10:27:56 -0700
Art Jacobson wrote on Monday, July 24, 2006:
>I am writing an application the relies heavily on distributed objects
>for communication between processes. The messaging tends to occur in
>bursts, and the message ordering is critical. When each of these
>messages are received, the receiver must perform a blocking operation
>(in my implementation this is carried out by a persistent worker
>thread so the receiving thread never blocks). The sending process
>must not block during this operation. When the incoming messages are
>received faster than they can be processed they are queued by some
>mechanism internal to Cocoa. My problem is that when these messages
>are dequeued, they are in the reverse order than when they are received.
>
>The DO message queuing is behaving like a FILO queue, not a FIFO as
>expected. Is there any way to change this behavior, or another way
>to do this with distributed objects?
I don't think so. I believe that the order and timing of oneway messages is "undefined."
I had a similar problem (a process that should not block when sending status messages and would create bursts of status update from time to time). I solved it by starting a second thread to send the status updates. The main thread just stuffs the updates into a dictionary then signals the secondary thread that there is something to send. The secondary thread uses regular (synchronous) DO message calls, so it knows when the update has been delivered.
Using this technique, I was also able to aggregate my status messages -- multiple status changes simply overwrite the previous value in memory and only the last value is sent in the next update message. This reduced my DO messaging considerably.
--
James Bucanek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden