From:  <[email protected]>
Reply-To:  <[email protected]>
Date:  Friday, April 4, 2014 at 5:17 AM
To:  <[email protected]>
Subject:  [beagleboard] std thread multithreading performance very low

> Hi, I use ubuntu build from this page http://elinux.org/BeagleBoardUbuntu
> <http://elinux.org/BeagleBoardUbuntu.>
> 
> When I create multiple threads with infinite loop(with sleep 10ms) by
> std::thread - cpu load is too high.
> 
> For example I create 21 thread like this
> 
> void test_class::foo()
> 
> {
> while (true)
> {
> std::this_thread::sleep_for(std::chrono::milliseconds(10));
> }
> }
> 
> and got cpu load about 40% !!! I'm new in beagle bone, so my questions: It's
> normal? What i do wrong?
My guess is that if you increased the sleep time, the cpu load would
decrease significantly. The time to schedule each thread is probably
significant compared to your sleep time, so when you run 21 threads, the
processor is doing nothing more than rescheduling your threads. The cpu load
of 40% sounds about right.

Regards,
John
> 
> 
> -- 
> For more options, visit http://beagleboard.org/discuss
> --- 
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to