Google News
logo
CherryPy - Interview Questions
Explain CherryPy Multithreaded Application Server.
CherryPy is designed based on the multithreading concept. Every time a developer gets or sets a value into the CherryPy namespace, it is done in the multi-threaded environment.

Both cherrypy.request and cherrypy.response are thread-data containers, which imply that your application calls them independently by knowing which request is proxied through them at runtime.

Application servers using the threaded pattern are not highly regarded because the use of threads is seen as increasing the likelihood of problems due to synchronization requirements.
The other alternatives include :

Multi-process Pattern : Each request is handled by its own Python process. Here, performance and stability of the server can be considered as better.

Asynchronous Pattern : Here, accepting new connections and sending the data back to the client is done asynchronously from the request process. This technique is known for its efficiency.

URL Dispatching : The CherryPy community wants to be more flexible and that other solutions for dispatchers would be appreciated. CherryPy 3 provides other built-in dispatchers and offers a simple way to write and use your own dispatchers.

* Applications used to develop HTTP methods. (GET, POST, PUT, etc.)
* The one which defines the routes in the URL – Routes Dispatcher

Advertisement