multiple instances of fphttpapp in same linux process lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Чебурашка · 2023-10-31 11:27 Hello, is it possible to have a linux process that creates multiple threads, and each thread contains a private instance of fphttpapp listening on a different port? Can there be interferences between the instances of fphttpapp (assumption is that they don't access to same resources while processing the requests)? Or is it better to run the fphttpapp instances in separated processes? I am having apparently unpredictable errors in an application arranged as single process, with multiple threads, each thread containing a fphttpapp instance, like I told at the beginning, and I am wondering if this could be the reason. Thanks ---------------------------------------------------------------------- Leledumbo · 2023-11-04 07:33 Quote from: Чебурашка on October 31, 2023, 12:27:34 pmHello, is it possible to have a linux process that creates multiple threads, and each thread contains a private instance of fphttpapp listening on a different port? I have my doubt due to the use of CustomApplication global variable. I haven't tested, but I think the answer is no. Quote from: Чебурашка on October 31, 2023, 12:27:34 pmI am having apparently unpredictable errors in an application arranged as single process, with multiple threads, each thread containing a fphttpapp instance, like I told at the beginning, and I am wondering if this could be the reason. The chance is not 0, so it could be. ---------------------------------------------------------------------- Чебурашка · 2023-11-05 10:22 I don't use the global variable present in the unit, I use locals defined within the thread instances. But still I am on alert because there is a lot of other components involved in each httpapp, and if just one is shared I will sooner or later get affected badly by uncontrolled thread concurrence.