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

Add a setting for multithreading #1259

Open
cargaji opened this issue Jul 12, 2024 · 3 comments
Open

Add a setting for multithreading #1259

cargaji opened this issue Jul 12, 2024 · 3 comments

Comments

@cargaji
Copy link

cargaji commented Jul 12, 2024

Is your feature request related to a problem? Please describe.
Some programs, such as Python with the numpy library, make use of multiple threads by default. isolate can be configured to allow or disallow the creation of threads.

The current behaviour is that languages that "require multithreading", such as Java and C# (Mono) are allowed an unlimited number of threads, and all others are limited to a single thread. Additionally, whenever one of the multithreaded languages are enabled in a contest, multithreading is enabled for all languages in that contest.

Describe the solution you'd like
A setting to indicate the level of multithreading allowed. This could be as simple as a global value for all contests (in cms.conf, which in turn is passed to isolate), or as complex as a per-task or per-contest (even per-contest and language) setting.

Describe alternatives you've considered

  • In the case of numpy, it can be configured to use a single thread.
  • Alternatively, CMS can be edited (specifically language.py#requires_multithreading) and recompiled, but this would require a redeployment of the system.
  • Either Java (JDK) or C# (Mono) can be enabled in a contest (even if the contestants should or won't use it), then multithreading is enabled for all submissions, even those that do not require multithreading.
@gollux
Copy link
Contributor

gollux commented Jul 13, 2024

I don't think that there is any reason for not enabling multithreading everywhere.

@snowynguyen
Copy link

Technically it is significantly harder for C++ competitive programmer to implement multithreading, and multithreading is in general not supported by official olympiad competitions. Therefore, I do support this issue!

@gollux
Copy link
Contributor

gollux commented Aug 7, 2024

Do you see any advantage that using multithreading would give to contestants? Remember that time limit in CMS applies to the sum of running times of all processes and threads spawned by the solution.

Re competitions: For example, current IOI rules allow multithreading.

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

No branches or pull requests

3 participants