fixes #1032:
- remove left-overs from OpenMP - replace omp_* calls with TBB equivalents
This commit is contained in:
@@ -29,7 +29,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define SERVER_FACTORY_H
|
||||
|
||||
#include "Server.h"
|
||||
#include "../Util/OpenMPWrapper.h"
|
||||
#include "../Util/SimpleLogger.h"
|
||||
#include "../Util/StringUtil.h"
|
||||
|
||||
@@ -39,11 +38,13 @@ struct ServerFactory
|
||||
{
|
||||
ServerFactory() = delete;
|
||||
ServerFactory(const ServerFactory &) = delete;
|
||||
static Server *CreateServer(std::string &ip_address, int ip_port, int threads)
|
||||
static Server *CreateServer(std::string &ip_address, int ip_port, unsigned requested_num_threads)
|
||||
{
|
||||
SimpleLogger().Write() << "http 1.1 compression handled by zlib version " << zlibVersion();
|
||||
std::string port_stream = IntToString(ip_port);
|
||||
return new Server(ip_address, port_stream, std::min(omp_get_num_procs(), threads));
|
||||
unsigned hardware_threads = std::max(1u, std::thread::hardware_concurrency());
|
||||
unsigned real_num_threads = std::min(hardware_threads, requested_num_threads);
|
||||
return new Server(ip_address, port_stream, real_num_threads);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user