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

ContextStack should be threadsafe #46

Closed
memlucky71 opened this issue Dec 4, 2017 · 0 comments
Closed

ContextStack should be threadsafe #46

memlucky71 opened this issue Dec 4, 2017 · 0 comments
Labels
bug something isn't working
Milestone

Comments

@memlucky71
Copy link
Contributor

memlucky71 commented Dec 4, 2017

With each request in the web, the request is added to a request queue. Then, Thread pool chooses a thread to serve the request and send back the response.
Finally, this thread is added to the thread pool. In nanohttp, whole the concept is managed through the Context. In nanohttp, it is possible to make nested context. For each request, a thread stack is created.
Since two requests can use a single context, this can run into problems. So the context should be handled thread safe using thread_local.

@memlucky71 memlucky71 added the bug something isn't working label Dec 4, 2017
@pylover pylover added this to the v1.x milestone Jun 26, 2018
@pylover pylover closed this as completed in 2128fb6 Aug 8, 2018
pylover added a commit that referenced this issue Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants