So I’ve been banging away at getting the threading test/benchmark code working.
I had originally looked to use the Windows-type createprocess approach in Linux (you can do so) but this is wrong – the way Windows does this is more limited, and I can imagine use cases with Linux where thee more flexible fork() method will be -necessary-. So now Windows will use CreateProcess() (which needs a command line binary to execute) and Linux will use fork(), and that choice then defines the porting abstraction layer.
I also decided to move all memory allocation fully back out to the test/benchmark library caller – there was helper code in the library, but it’s just making life complicated and is potentially going to get in the way for some users.
So I’ve sorted out the fundamentals of the porting abstraction layer.
That leaves the duration problem – bare C89, so no timers. How do we know how long to run tests for? see previous post for details.
What’s just occured to me is to classify each test as slow or fast, and on the command line, the user can specify the number of iterations for each class, to over-ride the defaults.
It’s some complexity, but there has to be some user involvement because there is no way to measure time, so it’s impossible in the code to figure out how long to run a test for.