Skip to content

Parallel scheduler namespace problems #2071

@vasama

Description

@vasama

The STDEXEC namespace is dependent on the definition of STDEXEC_NAMESPACE, which may be std::execution.

In __config.hpp there exists an unconditional definition of namespace std::execution::parallel_scheduler_replacement. It's unclear to me if this is intended.

In sudoku.cpp STDEXEC_NAMESPACE is locally defined as std::execution. However, this breaks when using STDEXEC_BUILD_PARALLEL_SCHEDULER , because parallel_scheduler_replacement is now built in a separate TU, which is unaware of the local namespace override. This nested namespace ends up in namespace STDEXEC in on TU and in namespace std::execution in another.

I also noticed that STDEXEC_BUILD_PARALLEL_SCHEDULER is not tested in CI, which is probably why this problem has gone unnoticed thus far.

I think the simplest solution here would be to:

  1. Use STDEXEC instead of std and nested namespace in sudoku.cpp.
  2. Define STDEXEC_BUILD_PARALLEL_SCHEDULER in the CI builds.
  3. Either remove or document the unconditional std::execution namespace in __config.hpp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions