Main  /  Edit version 1  /  Edit version 2  /   /  Users Area

Difference "cppcms::worker_thread & cppcms::application" ver. 1 versus ver. 2

Content:

## Roles
`worker_thread` and `application` are very similar classes that gives user similar APIs but they have important differences:
`worker_thread` has single instance in each worker thread or process, it is usually not used directly, but it is referenced by several `application` classes.
In many cases, we need to have more then one application or sub application in our process (for example wiki and forum or users panel and administration panel).
All these application share same controls like access to cache and sessions, access for HTTP requests --- all these stored in `worker_thread` class.
In terms of API, both classes are very similar with the difference that `worker_thread` stores actual data and `application` stores references to this data in `worker_thread`.
In most of cases developers should derive their own classes
from `cppcms::application` and not from `cppcms::worker_thread`.
## Constructors
worker_thread(manager const &s);
application(worker_thread &w);
`worker_thread` and `application` constructors should receive a reference to `manager` and primary `worker_thread`.
For example:
class my_application : public application {
my_application(worker_thread &w) : application(w) {
...

About

CppCMS is a web development framework for performance demanding applications.

Support This Project

SourceForge.net Logo

Поддержать проект

CppCMS needs You


Navigation

Main Page


Valid CSS | Valid XHTML 1.0