Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for running in-process in the same original thread #2589

Open
Youssef1313 opened this issue Jul 15, 2024 · 3 comments
Open

Support for running in-process in the same original thread #2589

Youssef1313 opened this issue Jul 15, 2024 · 3 comments

Comments

@Youssef1313
Copy link
Member

var runThread = new Thread(() => exitCode = ExecuteCore(host, executeParameters));

Currently, benchmarks always run on background thread. It would be great if a new Toolchain and Executor are run on the same thread, or a property is added to existing toolchains/executors to control whether a background thread is created or not.

@moritz-mg
Copy link

moritz-mg commented Jul 16, 2024

Actually, just came across this today - we need to benchmark with a native database ORM (Realm), which requires that its instance is created on the same thread that runs the code.
This fails with benchmarkdotnet as-is right now.

@timcassell
Copy link
Collaborator

Actually, just came across this today - we need to benchmark with a native database ORM (Realm), which requires that its instance is created on the same thread that runs the code. This fails with benchmarkdotnet as-is right now.

Can't you just set it up in [GlobalSetup] (and tear it down in [GlobalCleanup])?

@adamsitnik
Copy link
Member

This fails with benchmarkdotnet as-is right now.

With the default toolchain no threads are being created and every benchmark is executed in a dedicated, standalone process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants