0

Let's say we have server with four processors. I want to implement cache which will be served by four threads. The requirement - each thread should act on it's own processor?

How can we achieve this?

Don_Quijote
  • 936
  • 3
  • 18
  • 27

2 Answers2

1

You need to set the Thread Affinity for each thread to specify the CPU you want it to run on. There's some examples on the web on how to do it, but there's a nice GitHub repository here with some sample code on how to get it done. Esentially, set each threads affinity to a different core.

Vaughan Hilts
  • 2,839
  • 1
  • 20
  • 39
0

I know only about Windows OS and yes , it is possible, you need to program "mapped files" and also you need to set affinity for each process

http://msdn.microsoft.com/en-us/library/windows/desktop/aa366556(v=vs.85).aspx

Wally
  • 57
  • 5