3

I want to build all the boost asio http server examples from:

https://github.com/boostorg/asio/tree/develop/example/cpp03/http

But catch is, I need to use c++03/98, single threaded without dependencies on std::thread, boost::thread or posix threads. I also need static linking to all the other boost libraries. Also want to compile with g++ -O3 -flto on x86_64 Linux. How can I build these examples like this?

ericcurtin
  • 1,499
  • 17
  • 20

1 Answers1

0

It's not possible. Asio internally uses mutexes (which require some kind of threading library). Additionally in order to implement certain kinds of async operations, Asio actually needs to create a small number of worker threads.

Miral
  • 12,637
  • 4
  • 53
  • 93
  • 1
    Are you sure https://stackoverflow.com/questions/14981291/boostasio-internal-threads there's at least a define to turn off threads BOOST_ASIO_DISABLE_THREADS ? Just haven't figured out how to build these examples with the criteria above. – ericcurtin Dec 19 '18 at 14:31