Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> the moment you link against any 3rd-party library, you program can have arbitrarily many threads before it even reaches main().

what?! name one library that does this?



I've done some work with golang. Do not know if the libraries I used were bad, but they did some nasty things before main. Some even saw it as okay to call panic


I think the C++ version of the zeromq library could initialize a context in a static initializer, and zmq contexts involve creating a thread.


https://zeromq.org/get-started/?language=cpp#

there's 5 listed for c++ which one creates threads before main()?


It's been a long time, so I might be wrong, but with zmqpp[1] make a global zmqpp::context and I believe it will create threads before main().

1: https://github.com/zeromq/zmqpp


Windows will have a few threads for doing IO at program startup.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: