Drogon allocating resources for threads

  c++, multithreading, rest, web-deployment

I’m using drogon with main function like this

#include <memory>
using namespace drogon;
int main()
{
    app().setLogPath("./")
         .setLogLevel(trantor::Logger::kWarn)
         .addListener("0.0.0.0", 8080)
         .setThreadNum(4)
         .enableGzip(false)
        ;

    app().run();
}

I have one controller class that allocates resources in constructor (like memory, handles etc.). There are 4 threads for whole service (configured above in main). Is there a possibility that every thread will have it’s own data allocated and not share with other?
Ideally I would like the controller class to be created 4 times for every thread.
Is this possible?

Source: Windows Questions C++

LEAVE A COMMENT