fix bug: spawn: coro: stack size limit on windows
This commit is contained in:
parent
06707c4446
commit
774efcec0d
|
@ -134,7 +134,11 @@ namespace bserv {
|
|||
std::ref(req_),
|
||||
std::ref(routes_),
|
||||
std::ref(session_->ioc_),
|
||||
std::placeholders::_1));
|
||||
std::placeholders::_1)
|
||||
#ifdef _MSC_VER
|
||||
, boost::coroutines::attributes{ STACK_SIZE }
|
||||
#endif
|
||||
);
|
||||
}
|
||||
public:
|
||||
explicit websocket_session_server(
|
||||
|
@ -322,7 +326,13 @@ namespace bserv {
|
|||
std::ref(lambda_),
|
||||
std::ref(routes_),
|
||||
std::ref(ioc_),
|
||||
std::placeholders::_1));
|
||||
std::placeholders::_1)
|
||||
#ifdef _MSC_VER
|
||||
// currently, it is only identified on windows
|
||||
// that the default stack size is too small
|
||||
, boost::coroutines::attributes{ STACK_SIZE }
|
||||
#endif
|
||||
);
|
||||
// handle_request(parser_->release(), lambda_, routes_);
|
||||
|
||||
// at this point the parser can be reset
|
||||
|
|
|
@ -26,6 +26,10 @@ namespace bserv {
|
|||
//const std::string DB_CONN_STR = "dbname=bserv";
|
||||
const std::string DB_CONN_STR = "";
|
||||
|
||||
#ifdef _MSC_VER
|
||||
const std::size_t STACK_SIZE = 1024 * 1024;
|
||||
#endif
|
||||
|
||||
#define decl_field(type, name, default_value) \
|
||||
private: \
|
||||
std::optional<type> name##_; \
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
import requests
|
||||
import random
|
||||
from multiprocessing import Process
|
||||
|
||||
|
||||
def test():
|
||||
if random.randint(0, 1) == 0:
|
||||
resp = requests.get("http://localhost:8080/statics/js/bootstrap.bundle.min.js")
|
||||
else:
|
||||
resp = requests.get("http://localhost:8080/statics/css/bootstrap.min.css")
|
||||
if resp.status_code != 200:
|
||||
print(resp)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print('starting test')
|
||||
processes = [Process(target=test) for _ in range(200)]
|
||||
for p in processes:
|
||||
p.start()
|
||||
for p in processes:
|
||||
p.join()
|
||||
print('end of test')
|
|
@ -0,0 +1,22 @@
|
|||
import requests
|
||||
import random
|
||||
from multiprocessing import Process
|
||||
|
||||
|
||||
def test():
|
||||
if random.randint(0, 1) == 0:
|
||||
resp = requests.get("http://localhost:8080")
|
||||
else:
|
||||
resp = requests.get("http://localhost:8080/users")
|
||||
if resp.status_code != 200:
|
||||
print(resp)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print('starting test')
|
||||
processes = [Process(target=test) for _ in range(200)]
|
||||
for p in processes:
|
||||
p.start()
|
||||
for p in processes:
|
||||
p.join()
|
||||
print('end of test')
|
Loading…
Reference in New Issue