Why would use a fixed size queue? When I built the CORBA Events based logger
I made the Q a linked list!
I could see putting a cap on the size of the Q to avoid having it overwelm
the JVM heap if the l/O thread isn't keeping up... But I would think that I
would set this max pretty high and not expect to hit it. If I was regularly
maxing out here, I'd have some "volume" settings to regulate the number of
messages being logged.
-Chris.
> -----Original Message-----
> From: Joel Crisp [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, November 25, 1999 9:23 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Java implementation Query:Urgent
>
> Hi Sanjay
>
> You need to ensure that your queue is big enough, also remember that the
> log thread can remove _all_ messages on the queue in one go. Use one queue
> per worker thread.
>
> You should also block the worker thread if the queue is full and you
> can't tolerate lost log messages. Note that you should add a log message
> if this occurs and increase the queue size appropriately.
>
> Hope this helps
>
> Joel Crisp, Senior Java Architect, SUN PS Java Center (UK)
>
> Sanjay Nambiar wrote:
> >
> > Hi Joel,
> > I have tried to use a queue and implement a solution where Clients
> threads
> > that write to the queue use inter thread communication to notify a
> thread
> > which would then pick up the data and write to a file.
> > Here the getting from the queue and putting to the file methods are
> > synchronized.
> > The log class(helper class) is implemented as a Singleton.
> > However I still lose messages along the way when the number of hits to
> > writing to the queue increase in comparison to
> > writing to the File.
> > Joel I have not clearly understood your solution.
> > Could you elaborate with my example in mind.
> > Regards,
> > SANJAY
> >
> [DELETED]
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".