users@grizzly.java.net

Re: WG: Re: WG: Re: WG: Re: Asynchronous Request Processing with TCPIP

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 07 Jul 2008 10:27:20 -0400

Salut,

John ROM wrote:
>
> Hi Jeanfrancois,
> thank you very much.
> I tried it out but have a little problem.
> I call Ctx.suspend() and use it with a new Thread.

Yes.

> Problem is I cannot call resume() because the grizzly
> workerthread (protocolParser) might still be using the same context.

I see. But why are you resuming? Is it because you need more read
operations?


>
> Hmmh so might be best for me to give the new Thread a clone of
> context? But I always try to avoid copying (-:

Right. Tell me more about what you are trying to do so I can see if the
current solution can be improved.

Thanks

-- Jeanfrancois


>
>
>
>
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: Jeanfrancois Arcand [mailto:Jeanfrancois.Arcand_at_Sun.COM]
>> Gesendet: Freitag, 4. Juli 2008 21:18
>> An: users_at_grizzly.dev.java.net
>> Betreff: Re: WG: Re: WG: Re: Asynchronous Request Processing with TCPIP
>>
>>
>>
>> John ROM wrote:
>>> Hi Jeanfrancois,
>>>>> So more a Context.detach(); So I wonder if you could do somethink
>> like:
>>>>> suspend() {
>>>>> detach();
>>>>> ctx.setKeyRegistrationState(KeyRegistrationState.NONE))
>>>> Here you means KeyRegistrationState,REGISTER, right?
>>>>
>>> Ups yes for sure!
>>>> So in your case I would think you can do:
>>>>
>>>> Context.suspend();
>>>> Thread.detach();
>>> // We suspend, but we still want to get OP_READ event
>>>> ctx.setKeyRegistrationState(KeyRegistrationState.REGISTER);
>>>
>>>> How does it sound? Let me know as I will make sure I can support your
>>>> scenario before commiting the code :-)
>>> Terrific!
>>>
>>> No super many thanks!!,
>>> It will make my code cleaner!!
>> Done. Available as 1.8.2-SNAPSHOT :-)
>>
>> A+
>>
>> -- Jeanfrancois
>>
>>
>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>