Giter VIP home page Giter VIP logo

Comments (4)

dylni avatar dylni commented on July 17, 2024 1

This is a great idea. I've looked into it a bit, and it seems fairly straightforward on Windows, as expected. Unix will be more complicated but should be possible too.

However, I should point out that a programming judge would likely need a separate environment for user programs. There will always be a way to circumvent limits from this crate, potentially allowing programs to damage the system. This crate is mostly intended for trusted programs that might unintentionally exceed their limits, such as code run by test harnesses. Does that still work for your use case?

from process_control.

lmbaeza avatar lmbaeza commented on July 17, 2024

Yes, it does still work for my use case

I have mentioned the example of the virtual judge to get the idea across, but I am also running and monitoring a reliable process, which in the worst case can exceed the defined memory limits.

I think that feature can be useful in many other use cases.

from process_control.

dylni avatar dylni commented on July 17, 2024

I think that feature can be useful in many other use cases.

I agree. This has been implemented in version 3.2.0 and will be released tomorrow. The API doesn't exactly match the one in this issue, since it resembles the syscalls offered by supported platforms. They cause allocation to fail if the memory usage would be above the memory limit.

Also, MacOS isn't currently supported, since it doesn't offer syscalls for limiting memory usage.

from process_control.

dylni avatar dylni commented on July 17, 2024

Version 3.2.0 has been released with Control::memory_limit, so I'm closing this issue. Let me know if you have any issues.

from process_control.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.