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.
On 2017-05-05 14:27, Brian wrote:
> If a thread is dedicated to say , polling a serial or Ethernet port
> has a high input data rate , then dedicating one CPU to that
> task/thread is
Isn't the speed of serial (so slow) that it would be overkill to
dedicate a Cpu to it?
Maybe usb 2 or 3, or possibly Gigabyte ethernet 1000 speed ;-)
I should have said "streaming" rather than "serial". True Parallelism is a long way off in the future , but a form of parallelism can be had using multiple CPU cores and hard affinity as described in the excellent article.
Consider the case of a special purpose custom design PCIe card and Linux. The classical way to interface with the card is to write an interrupt handler and accept the fact that doing so opens all your proprietary code due to the GPL. It also must wrestle with the black magic mess of BIOS PCI IRQ assignment and conflicts with other hardware.
Another approach is to memory map the PCIe card in user space, use hard affinity and dedicate one CPU core to poll the card memory in user space. In this case the GPL does not apply and the issue of IRQ assignment is not an issue.
Another approach is to abandon the add-in (PCIe) card approach and use gigabit Ethernet with a dedicated CPU core as the I/O. This what was done on the current project.