cms-dev / cms

Contest Management System
http://cms-dev.github.io/
GNU Affero General Public License v3.0
898 stars 362 forks source link

Add a setting for multithreading #1259

Open cargaji opened 3 months ago

cargaji commented 3 months ago

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

gollux commented 3 months ago

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

snowynguyen commented 3 months ago

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 commented 3 months ago

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.