[fpc-pascal] Threading vs Parallelism ?
Brian
vmst at golden.net
Sat May 6 17:12:25 CEST 2017
The information about using affinity with Linux was only posted so anyone
who was interested could use it , and was not intended as an addition to
Free Pascal.
Regrading the previous comment about the hardware buffering the data , one
still must do something with the data in user space. The choice there is to
let the OS / CPU decide which core to use or dedicate a CPU core to the
thread. Your choice.
Here is the code and the Linux library you must link to in order to use the
functions.
{$LINKLIB libc.so}
...
function sched_getaffinity(pid : Ptruint; cpusetsize : longint; cpuset :
pointer) : longint; cdecl; external;
function sched_setaffinity(pid : Ptruint; cpusetsize : longint; cpuset :
pointer) : longint; cdecl; external;
function pthread_setaffinity_np(pid : Ptruint; cpusetsize : longint; cpuset
: pointer) : longint; cdecl; external;
function pthread_getaffinity_np(pid : Ptruint; cpusetsize : longint; cpuset
: pointer) : longint; cdecl; external;
Brian
--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Threading-vs-Parallelism-tp5728018p5728443.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
More information about the fpc-pascal
mailing list