What's the best way to design custom threadpool

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What's the best way to design custom threadpool

yangjun2
hi,
  I want to desgin custom threadpool with business key,but no enough business data in IOStategy,
so I don't use default workthreadpool.

call flow of Server side :
                READ/ACCEPT
kernelThreadPool--->SameThreadIOStrategy--->CustomFilter--->CustomThreadpool(control thread num with business key)

It's OK?
Best Regards,
Young
Reply | Threaded
Open this post in threaded view
|

Re: What's the best way to design custom threadpool

oleksiys
Administrator
Hello,

> hi,
>    I want to desgin custom threadpool with business key,but no enough
> business data in IOStategy,
> so I don't use default workthreadpool.
>
> call flow of Server side :
>                  READ/ACCEPT
> kernelThreadPool--->SameThreadIOStrategy--->CustomFilter--->CustomThreadpool(control
> thread num with business key)
>
> It's OK?
Absolutely.
Here you can find a sample, which might be useful [1]. It's async echo
filter, which performs "echo" in the custom thread pool.
Make sure you correctly suspend and resume FilterChainContext.

WBR,
Alexey.


[1]
http://java.net/projects/grizzly/sources/git/content/samples/framework-samples/src/main/java/org/glassfish/grizzly/samples/echo/EchoFilterAsync.java
> -----
> Best Regards,
> Young
> --
> View this message in context: http://grizzly.1045725.n5.nabble.com/What-s-the-best-way-to-design-custom-threadpool-tp4531236p4531236.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.