Running an application using CPU affinity within Docker

I have a C++ application that currently runs on bare metal that I am looking to run within a docker container.

The application uses client libraries that allow you to pin a thread to a specific CPU core, so within the config and code I can say ‘process this set of data using cpucore 3, and this other set of data using cpucore 2’.

I would like to get a better understanding of how this would execute if I simply packaged up the application into an image and ran it and did not specify any ‘–cpuset-cpus’.

When running through a container, what would be the expected behaviour? Would the threads fan out as required and run on their pinned CPUs or would the container runtime constrain this behaviour in some way?

I’m just beginning my research on this topic. I’ve been looking at the CFS and real-time schedulers to see if switching to the RT scheduler is something I might need to consider.