cms-dev / cms-dev/cms

Add a setting for multithreading

Open
#1,259 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
412
Avg merge
6d 10h
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading grading/language.py at requires_multithreading and trace how cms.conf is passed to isolate. Compare the current language-based behavior with the requested global, contest, task, or language-specific options. Done means the chosen setting scope is defined and multithreading limits are applied consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.