users@grizzly.java.net

Re: CometEngine.register thread safety

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 07 Jul 2008 09:11:53 -0400

Hi Dan,

Dan Dubois wrote:
> Hello All,
>
> I want to use CometEngine.register in my servlet doGet request.
>
> However looking at the source code v1_8_0_1
> (https://grizzly.dev.java.net/source/browse/grizzly/tags/1_8_0_1/modules/comet/src/main/java/com/sun/grizzly/comet/CometEngine.java?rev=1268&view=markup
> <https://grizzly.dev.java.net/source/browse/grizzly/tags/1_8_0_1/modules/comet/src/main/java/com/sun/grizzly/comet/CometEngine.java?rev=1268&view=markup>)
> I believe that CometEngine.register is not thread safe. Do you agree
> with this?

Yes.

>
> The reason I bring this up is because I can see quite a few use cases
> where one would want to register a CometContext in a multithreaded
> environment, for example in a servlet event. Do you agree that it might
> be good to either document the lack of thread safety of make is threadsafe?

I fully agree. Since you looked at it, can you point me to the other
place? Or better, send me a svn diff :-) :-) :-)



>
> The main reason I am taking time to comment is because I think Grizzly
> is excellent and want to help it get even better.


Thanks!

>
> Best wishes,
>
> Dan
>