Shortcomings in the shared memory of multithreaded projects

I am trying to create my first multithreading application that scales to multi-core technologies. His inspiration comes from the concept of an event-driven neural network.

The design is a bit like this: the data structure of the algorithm is stored in 1 place in memory in the form of class instances. An example of a task that can be performed in this structure is neurons: it changes several values ​​in a neuron and connected neurons and determines any future tasks that may need to be performed. Tasks that must be completed are added to the queue. There are several threads whose only function is to pull the task out of the queue, complete the task and retry the rinse. Any value updates can be performed in any order if they are performed. Small but rare errors resulting from this parallelism will have a statistically insignificant impact on system performance.

This design does not use memory other than shared memory (with the possible exception of a small amount of allocated memory used for calculations). I recently went through several lectures that said that using shared memory in multicore and graphical applications was very slow. Despite the fact that I have several ideas as to why this may be so, I would like to learn from people who have experience with similar things, and perhaps be directed to a useful resource to help me.

+3
source share

All Articles