I would at least remove the  "*2" from the initialization.

We could initialize the number of threads in the pool to 0 or 1.

But I don't understand why initializing threads for the thread pool may cause 
an error whereas initializing threads for a filter in the pre-thread pool 
implementation does not.  Both should be creating 
GetGlobalDefaultNumberOfThreads() threads in rapid succession.

Jim

From: Brahmakshatriya, Umang (GE Global Research)
Sent: Monday, April 07, 2014 9:28 AM
To: Bradley Lowekamp; Miller, James V (GE Global Research)
Cc: [email protected]
Subject: RE: [ITK-dev] [ITK] Thread Pool patch

MultiThreader::MultiThreader() : m_ThreadPool(ThreadPool::New() )




187<javascript:void(0)>

{


188<javascript:void(0)>

  m_ThreadPool->InitializeThreads(GetGlobalDefaultNumberOfThreads() * 2);



I was aware of this issue and had mentioned about this to Jim - If we demand 
too many simumtaneous pthreads to be started, the pthread_create call returns 
error code 11 
(http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html ). So if 
the above call returns the correct number of threads, I think we should be fine 
unless we are creating more than one "thread pools".

Umang Brahmakshatriya
Advanced Computing Lab
GE Global Research
1 Research Circle K1-3A37C
Niskayuna, NY 12309

From: Bradley Lowekamp [mailto:[email protected]]
Sent: Monday, April 07, 2014 9:13 AM
To: Miller, James V (GE Global Research)
Cc: Brahmakshatriya, Umang (GE Global Research); 
[email protected]<mailto:[email protected]>
Subject: Re: [ITK-dev] [ITK] Thread Pool patch

Jim,


Yes it was. But I set ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS to 8, and did ctest 
-j 8 initially, then I scaled back from there with lack of complete success in 
testing. There are thread management issue with the current patch.

Brad

On Apr 4, 2014, at 2:06 PM, Miller, James V (GE Global Research) 
<[email protected]<mailto:[email protected]>> wrote:

"Too many threads" is a bit odd.  Umang does initialize the pool with a set of 
threads, then adds threads as needed. I believe the thread initialization is 
based on the number of cores.  But in principle, the initialization could be as 
low as 0 or 1 threads.

I missed that in the patch. This is what I saw:
m_Threadpool(m_Threadpoolfactory.GetSmartThreadPool(GetGlobalDefaul
tNumberOfThreads() * 2) )





185

{




Was this on one of your giant core machines?

Jim

Brad

On Apr 4, 2014, at 10:42 AM, Brahmakshatriya, Umang (GE Global Research) 
<[email protected]<mailto:[email protected]><mailto:[email protected]>> wrote:

Hi All,

My name is Umang, I am working to submit the Thread Pool patch. Can anyone help 
me through the final steps of submitting it? I had a few issues creating the 
patches.
I am available next week at these times:
Tuesday 4/8 - 2.30p to 5p EST
Wednesday 4/9 -  9.30am to 12p EST
Thursday 4/10 - 2.30p to 5p EST

Let me know which time works best and I will setup a t-con and webex / google 
hangout.



Umang Brahmakshatriya
Advanced Computing Lab
GE Global Research
1 Research Circle K1-3A37C
Niskayuna, NY 12309

_______________________________________________
Powered by www.kitware.com<http://www.kitware.com><http://www.kitware.com/>

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers
_______________________________________________
Community mailing list
[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>
http://public.kitware.com/cgi-bin/mailman/listinfo/community

_______________________________________________
Powered by 
www.kitware.com<http://www.kitware.com<http://www.kitware.com%3chttp:/www.kitware.com>>

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers

<<inline: image001.gif>>

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers

Reply via email to