[ 
https://issues.apache.org/jira/browse/HBASE-15784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15273839#comment-15273839
 ] 

Jingcheng Du commented on HBASE-15784:
--------------------------------------

bq. Better change this method signature itself to avoid one param.. just pass 
maxThreads. Similar in other classes also.. This will make sure that later, in 
same class, no one will do the same mistake again.
These methods allow users to pass in a queue instead of LinkedBlockingQueue, 
and SynchronousQueue doesn't have such an issue.
And in these methods of the patch, the core pool size is set as max pool size 
if LinkedBlockingQueue is used. I think it is okay to keep the same method 
signature?

bq. Pls see whether any of the removed configs mentioned in habse book as well. 
If so we have to clear those as well.
Got it. I will check it.

bq. So now we will have much more number of threads initially after the process 
is started. (As core size is same as max size).. After the time out period many 
of the threads will get died.
The pool starts a thread only when the execution is requested. And the pool 
allows the core threads to die when timeout if allowCoreThreadTimeOut is set as 
true. I think the number of threads should be okay if the number of requests is 
moderate.

> MIsuse core/maxPoolSize of LinkedBlockingQueue in ThreadPoolExecutor
> --------------------------------------------------------------------
>
>                 Key: HBASE-15784
>                 URL: https://issues.apache.org/jira/browse/HBASE-15784
>             Project: HBase
>          Issue Type: Bug
>          Components: Client, Replication, Thrift
>            Reporter: Jingcheng Du
>            Assignee: Jingcheng Du
>         Attachments: HBASE-15784-v2.patch, HBASE-15784.patch
>
>
> LinkedBlockingQueue is usually used in ThreadPoolExecutor. It allows the 
> thread pool not to be blocked if the number of running threads in the pool is 
> less than the max pool size and the queue is not full.
> But when the core pool size of ThreadPoolExecutor is different from the max 
> pool size, the things don't go as expected. When the number of running 
> threads is the same with the core size, more requests of executions are added 
> into the LinkedBlockingQueue. And the requests can be executed again only 
> when LinkedBlockingQueue is full or some of running threads are finished.
> Thus it is better to use the same value for the core and max pool size when 
> the LinkedBlockingQueue is used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to