# Multithreaded Filtering

To make sure that multithreaded filter processes are thread-safe, you must create a unique context pointer for every thread by calling fpInit() or fpInitWithLicenseData(). In addition, threads must not share context pointers, and the same context pointer must be used for all API calls in the same thread. This applies to in-process and out-of-process API calls. Creating a context pointer for every thread does not affect performance because the context pointer uses minimal resources.

For example, C code for file filtering must have the following logic in a thread:

    fpInit()
       KVGetExtractInterface()
       fpOpenFile()
       fpGetMainFileInfo()            /* container file */
       fpGetSubFileInfo()
       fpExtractSubFile
       fpGetSubFileMetadata()
       fpFilterFile()
       fpCloseFile()

       fpOpenFile()
       fpGetMainFileInfo()            /* not a container file */
       fpGetDocInfoFile()
       fpGetOLESummaryInfoFile()
       fpFilterFile()
       fpCloseFile()
       ...
    fpShutdown()

© Copyright 2016-2020 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a mail client, and then send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm