> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Out-of-Process Server Implementation

> Load ABBYY FineReader Engine as an out-of-process server on Linux for thread-safe server applications using OutprocEngineLoader.h, FREngineOutproc.h, and OutprocSafePtr.h.

<Note>
  This topic applies to FRE for Linux.
</Note>

This method of loading allows you to load ABBYY FineReader Engine as an out-of-process server into a separate process. If this loading method is used, all ABBYY FineReader Engine objects are completely thread-safe. Each FineReader Engine instance runs in a separate process simultaneously with the other instances. It allows you to create a pool of processors and make full use of the available CPU power. For this reason, using this method is particularly suitable for server applications.

For loading Engine into a separate process as an out-of-process server use the files provided in the distribution:

* The OutprocEngineLoader.h file declares initialization and deinitialization methods of the Engine object (for C++ use the [InitializeEngine](/fine-reader/engine/api-reference/functions/initializeengine-function) and ExplicitlyUnload functions declared in this header file).
* The FREgnineOutproc.h file is included in the OutprocEngineLoader.h. It is an analog of the FREngine.h file for multi-threaded solutions that supports the same methods and interfaces except for the methods for reference counting and methods with SAFEARRAY parameters.
* The methods declared in FREngineOutproc.h do not handle reference cycles. That is why a specific implementation of SafePtr is represented in the OutprocSafePtr.h file, which you can find in the code samples describing the loading as an out-of-process server. You can include this header file or create your own.
* Every loading of the Engine into a separate process requires one TCP port. The configuration file OutprocConfig.ini contains the interval of available ports for inter-process communication.
* If your application works with С++, additionally link the libOutprocClientLib.so library in your project.
* If you work with Java wrapper, use com.abbyy.Outproc.FREngine.jar instead of com.abbyy.FREngine.jar. These files are included in ABBYY FineReader Engine [distribution package](/fine-reader/engine/distribution/distribution-windows/distribution-kit).

See [Hello (Outproc)](/fine-reader/engine/guided-tour/samples#hello_outproc) and [Multithreading](/fine-reader/engine/guided-tour/samples#multithreading) code samples, which demonstrate loading the Engine as an out-of-process server and provide a reusable solution for multi-threaded applications for C++ and Java.

The Engine object loaded as an out-of-process server has peculiarities of using ABBYY FineReader Engine objects and methods:

* You must specify the sequential mode of document processing by setting the [MultiProcessingMode](/fine-reader/engine/api-reference/parameter-objects/multiprocessingparams#multiprocessingmode) property of the [MultiProcessingParams](/fine-reader/engine/api-reference/parameter-objects/multiprocessingparams) object to MPM\_Sequential.
* You must pass NULL for parameters derived from IUnknown. These parameters are commonly used in export methods. To pass the export parameters in an alternative way, create a [user profile](/fine-reader/engine/guided-tour/advanced-techniques/working-with-profiles#user_profiles) with the desired settings.
* The Engine object loaded as an out-of-process server does not support working with:
  * callbacks and methods with parameters derived from callbacks
  * interfaces and methods for opening images from memory

You may also speed up the iteration of the document layout with the scheme described in [Working with Layout and Blocks](/fine-reader/engine/guided-tour/advanced-techniques/working-with-layout-and-blocks).
