PasteServer | PasteServer to upload text or code | File Upload library
kandi X-RAY | PasteServer Summary
kandi X-RAY | PasteServer Summary
PasteServer to upload text or code. Demo:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of PasteServer
PasteServer Key Features
PasteServer Examples and Code Snippets
Community Discussions
Trending Discussions on PasteServer
QUESTION
I'm trying to set up a web service that processes a rendering in background, which takes a minute. While the rendering is in progress i want the server to be able to handle requests in parallel, returning Id {} not found
or the result if there is one.
The tutorials i found mainly handle simple requests without much processing (http://bottlepy.org/docs/dev/async.html, using sleep
to emulate processing). So i'm not quite sure how to implement threading - should the bottlepy routes be set up in a thread?
From http://bottlepy.org/docs/dev/tutorial_app.html#server-setup i know that the default server of bottlepy is single-threaded so i tried to switch to another server (PasteServer).
...ANSWER
Answered 2019-May-27 at 13:23Solved it.
The rendering process was implemented in C++, bound with PyBind. The Global Interpreter Lock (GIL) prevented the concurrent execution of rendering and webserving, so i added py::gil_scoped_release release;
before and py::gil_scoped_acquire acquire;
after the expensive calculations in the C++ code. In the code above i added a snippet to calculate pi directly in python without C++/PyBind, so the bottlePy developer could point me onto that GIL thing. (Thx Marcel)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PasteServer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page