What to avoid for performance reasons in multithreaded code?

后端 未结 12 2435
执笔经年
执笔经年 2021-02-09 10:45

I\'m currently reviewing/refactoring a multithreaded application which is supposed to be multithreaded in order to be able to use all the available cores and theoretically deliv

12条回答
  •  灰色年华
    2021-02-09 11:28

    You should first be familiar with Amdahl's law.

    If you are using Java, I recommend the book Java Concurrency in Practice; however, most of its help is specific to the Java language (Java 5 or later).

    In general, reducing the amount of shared memory increases the amount of parallelism possible, and for performance that should be a major consideration.

    Threading with GUI's is another thing to be aware of, but it looks like it is not relevant for this particular problem.

提交回复
热议问题