File: README.md

package info (click to toggle)
witty 3.3.3%2Bdfsg-4.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 28,228 kB
  • ctags: 26,694
  • sloc: cpp: 147,809; ansic: 77,999; xml: 16,331; sh: 1,303; makefile: 198; java: 86; sql: 14
file content (34 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Wt legacy integration example
-----------------------------

As Wt is often used to upgrade existing desktop applications to the web,
it is common that these applications cannot handle the constant thread
switching done by Wt.

Wt uses a thread pool which handles incoming requests, and subsequent
requests to the same session can potentially be handled by different
threads. Although in most cases one can avoid this problem by simply
using Wt with a thread pool having a single thread, such a
configuration cannot handle recursive event loops (which block the
thread while waiting for a new event, but this new event then arrives
at a thread pool without threads ready for processing).

This example provides a specialized WApplication class
(SingleThreadedApplication) which will allocate a dedicated thread to the
session and which performs all event handling from within this thread.

This can be used in combination with a process-per-session deployment
model (as facilitated by the FastCGI connector) to isolate each
session in its own process and within a single thread.

How to run
----------

See the README in the parent directory.

What it illustrates
-------------------

How a legacy application, which requires a single thread for the
entire duration of a session and still requires recursive event loops,
can be ported to Wt.