Code Monkey home page Code Monkey logo

Comments (2)

garfr avatar garfr commented on August 15, 2024 1

An obvious way to implement the concurrency in this seems to be with thread pools and task queues, and it shouldn't be hard. The other obvious option is just to have one OS thread per request but this should only be temporary due to its inefficient nature. We could leave the number of threads in the pool to be fine tuned allowing for the kind of hard limits you are talking about.

from simple-http-server.

bama4 avatar bama4 commented on August 15, 2024

I agree. There is a set number of threads in a pool, and the tasks are queued. Threads take the next task in the queue, execute that task, and then pick up the next task in the queue. So basically we would need to implement queue and thread pool types. Maybe we should make a 'utils' folder for these utility objects. It would not be one thread per connection/request in this case but rather a thread executing a task from the queue.

from simple-http-server.

Related Issues (13)

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.