Peter Donald wrote:

On Sat, 15 Dec 2001 02:32, Berin Loritsch wrote:

Avalon:

PreparedEnqueue transaction = source.prepareEnqueue( events ); // Avalon
queues start with a source. if ( should_commit )
{
    transaction.commit(); // Never have a bad key!
}
else
{
    transaction.abort(); // Never have a bad key!
}


+1


I'm glad you like it. :)




I would like to have reactions on the Blocking and EventDropping issues
though....


Event dropping should be an application specific thing. However I am not sure why Blocking and non-Blocking versions of interfaces need to be separate. I haven't looked closely at the proposal though - will try to do so real soon now ;)


Yes, but should they affect the way a system is written?  For instance,
the basic operation of dequeue() doesn't change.  Is it sufficient
for the blocking timeout to be set once for the pipeline, or should it be
set for *each* dequeue() method?  Personally, I lean toward setting it once.

The only use I _personally_ see for a blocking queue is something like the
CommandQueue that I will expand this proposal to include.  In that case,
there is a reason to block the thread.  However, in the full staged system,
blocking would be detrimental.

Also, the EventDropping thing is arguably an application specific thing,
so if that is the consensus, I will add it to the Source interface as
tryEnqueue() which is much better than enqueue_lossy(), and is more semantically
correct.

SEDA:

boolean success = queue.enqueue_lossy( event );
if ( ! success )
{
    handleFailure();
}

Avalon:

boolean success = queue.tryEnqueue( event );
if ( ! success )
{
    handleFailure();
}

The name tryEnqueue builds on the familiar tryAquire() in Mutex and 
DijkstraSemaphore.

The name enqueue_lossy() seems to leave too many questions unanswered by it's
name.  Restated, I will easily derive the logic of tryEnqueue() without having
to read the documentation (enqueue_lossy raises questions of algorithm and is 
the
queue going to drop other events to make room for this one?).




--

"They that give up essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety."
                - Benjamin Franklin


-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Reply via email to