[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Threads

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 20
Thread images: 2

File: smtoff4workers.png (65KB, 566x368px) Image search: [Google]
smtoff4workers.png
65KB, 566x368px
As a programmer, what do I need to do to optimize a program for multiple cores/threads? The future is obviously in more and more threads, but It feels like some programs don't benefit enough from it.
I already do compute intensive tasks on separate threads, but is that all it takes? Optimizing for concurrent execution sounds crucial for me.
>>
It's simple, just throw your work into multiple processes and the OS scheduler will do it for you.
>>
>>61039370
Isn't that the same as running one process and using multiple threads? Thread management is also done by the OS, isn't it?
>>
>>61039404
One is more difficult than the others.
>>
>>61039211
>is that all it takes

Does your CPU utilization continously look like in your picture? Then job well done.

If not, run a CPU profiler and you'll find out exactly where the CPU intense operations are, or any bottlenecks in form of waits.
>>
Get a book

Too much to explain in 2000 characters
>>
>>61039847
This, you need to learn to locate the bottlenecks in your program first and optimize it the best way you can. Throwing threads and cores to the problem could make the program slower.
>>
>>61039211
Do everything explicitly with either openmp or mpi. And if you're compiler doesn't support them stop using such a shit language.
>>
>>61039211
You should've bought Intel, anon. It doesn't have this problem.
>>
>>61040876
>It doesn't have this problem.
Yeah, too few cores for the same money.
>>
>>61039370

> Brainlet
>>
>>61040964
Intel 4 cores = AMD 8 cores
>>
>>61041071
>>61040876

1 Intel RAID key has been shipped to your address, thanks again for your work.

Regards,
Shlomo #5,697
>>
>>61041071
So Intel 8 cores is slower than AMD 8 cores but Intel 4 cores is faster than AMD 8 cores?
Really makes you think.
>>
>>61039211
Use Go.
>>
>>61039211
Don't optimize for a problem you only think exists.

Chances are, single threaded is fine for your purposes. (The OS will distribute running programs across cores/threads to load balance)
>>
>>61041071
2011 called, they want their memes back.
>>
>>61041117
Depends on whether performance is actually needed.

If it's just some game that runs fine on anything, then don't bother.
>>
>>61041159
Exactly, but at that point you know for sure there's a problem.

Making a multi threaded program just because you think the processor doesn't have a distributed enough load is a bad idea.
>>
>>61041071
No?
>>61041117
I think this mentality results in "okay, we have X cores in our CPU, but our software does not benefit from it enough"
Thread posts: 20
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.