0

Imagine that I have a linux program that does some network IO. Execution of the program is not deterministic: it gonna produce different results depending on how it's threads are scheduled, what random values provided by OS, how kernel IO is handled, how long it gonna take to execute this or that piece of code, what memory is in CPU cache.

Is it possible to configure docker run in such a way, that I will always have exactly same behavior of the program? Just specify some random seed before run and have exactly same kernel scheduling, exactly same CPU cache? Given that all input is provided precisely in same time.

Probably it's not possible today, but what are limitations for implementation of that kind of deterministic runs?

  • You could capture the network I/O with precise timestamps, and then replay it with an emulator, injecting it at the correct (simulated) times. Will require modifying the emulator a bit, and won't run in realtime. It will also require an emulator that handles cache misses and their timing (or ignores caches completely). – dirkt Dec 11 '18 at 15:12
1

A docker container is just a process with different namespaces, it otherwise runs in the system exactly like other processes (in particular its thread and I/O scheduling). So if you can't to it do a standard process you can't do in in a Docker container.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.