Re: SEQUENCE tracking

From: Ed prochak <ed.prochak_at_alltel.com>
Date: 25 Mar 2002 14:34:06 -0800
Message-ID: <e51b160.0203251434.1c66cde1_at_posting.google.com>


Looks like the same problem NEWS readers have. There each reader maintains a list of messages read, coalescing the list into ranges when possible.

Lots of questions still. If a reader goes off-line, does it start reading again from the beginning when it restarts or should it pick up where it left off?

If a new reader comes online, where does it start? from 1? (your message table will continually grow bigger) or from the most "recent"? or from some special value?

If the messages are permanently stored in the table, then a reader-side list makes sense. Simply maintain the list in the reader and query the message table priodically to find new messages (i.e., messages not in the "already read this message" list). no locking needed (performace may be crappy when the table gets big, but some tradeoffs have to be made.)

Only real problem is the issue of lost sequence numbers. If 5 neve gets used, your readers will always be looking for it.

I haven't seen any mention, but why do I get the impression that this is for an on-line gaming system?

   Ed Prochak
Magic Interface, Ltd.

eran_at_prosight.com (Eran Dvey-Aharon) wrote in message news:<ce3f1689.0203240555.1194e5eb_at_posting.google.com>...
> Thanks Jim, but I can't use AQ, because I want to broadcast messages.
> When a 'writer' thread writes a message, I want all 'readers' to read
> it.
> I will implement a cleanup once in a while - that is not the problem.
>
> The problem is that the 'readers' want to know what the've read, and
> what they haven't.
> I could do it by locking the table, write (a short) message, and then
> unlock, but then it is outside my main transaction, and this is very
> dangerous.
>
> Eran
>
> "Jim Kennedy" <kennedy-family_at_attbi.com> wrote in message news:<aPhn8.104077$af7.56191_at_rwcrnsc53>...
> > use advanced queuing.
> > Jim
> > "Eran Dvey-Aharon" <eran_at_prosight.com> wrote in message
> > news:ce3f1689.0203240204.5038600f_at_posting.google.com...
> > > Hi all !
> > >
> > > I have the following problem :
> > > Many processes/threads write into a common table, that I use as a
> > > messaging queue. I use sequences, and that way the writers don't block
> > > each other.
> > >
> > > I also have many readers. The readers should be able to read all the
> > > entries that they didn't read before.
> > >
> > > How can I accomplish that ?
> > > To those of you that don't understand the problem : if the reader
> > > reads messages 1,2,3,4,6,7,8 it can't assume that messages # 5 will
> > > never be written.
> > > It might be in the process of writing.
> > > I also don't want to add any locks to this scheme. The readers should
> > > read only the new committed messages, and the writers should be able
> > > to write without being blocked.
> > >
> > > Any ideas ?
> > >
> > > Eran
Received on Mon Mar 25 2002 - 23:34:06 CET

Original text of this message