Typically it is best to run one process per CPU.
Tornado includes a built-in multi-process mode to start several
-processes at once. This requires a slight alteration to the standard
-main function:
+processes at once (note that multi-process mode does not work on
+Windows). This requires a slight alteration to the standard main
+function:
.. testcode::
non-blocking DNS resolver that can be used when threads are not
appropriate.
-**Platforms**: Tornado should run on any Unix-like platform, although
-for the best performance and scalability only Linux (with ``epoll``)
-and BSD (with ``kqueue``) are recommended for production deployment
-(even though Mac OS X is derived from BSD and supports kqueue, its
-networking performance is generally poor so it is recommended only for
-development use). Tornado will also run on Windows, although this
-configuration is not officially supported and is recommended only for
-development use. Without reworking Tornado IOLoop interface, it's not
-possible to add a native Tornado Windows IOLoop implementation or
-leverage Windows' IOCP support from frameworks like AsyncIO or Twisted.
+**Platforms**: Tornado is designed for Unix-like platforms, with best
+performance and scalability on systems supporting ``epoll`` (Linux),
+``kqueue`` (BSD/macOS), or ``/dev/poll`` (Solaris).
+
+Tornado will also run on Windows, although this configuration is not
+officially supported or recommended for production use. Some features
+are missing on Windows (including multi-process mode) and scalability
+is limited (Even though Tornado is built on ``asyncio``, which
+supports Windows, Tornado does not use the APIs that are necessary for
+scalable networking on Windows).
Documentation
-------------
exception.
max_restarts defaults to 100.
+
+ Availability: Unix
"""
if max_restarts is None:
max_restarts = 100
In many cases a close callback on the stdout or stderr streams
can be used as an alternative to an exit callback if the
signal handler is causing a problem.
+
+ Availability: Unix
"""
self._exit_callback = callback
Subprocess.initialize()
to suppress this behavior and return the exit status without raising.
.. versionadded:: 4.2
+
+ Availability: Unix
"""
future = Future() # type: Future[int]
.. versionchanged:: 5.0
The ``io_loop`` argument (deprecated since version 4.1) has been
removed.
+
+ Availability: Unix
"""
if cls._initialized:
return
When using multiple processes, no IOLoops can be created or
referenced until after the call to ``TCPServer.start(n)``.
+ Values of ``num_processes`` other than 1 are not supported on Windows.
+
The ``max_restarts`` argument is passed to `.fork_processes`.
.. versionchanged:: 6.0