Title: Threads exit upon creation. · Issue #50 · etr/libhttpserver · GitHub
Open Graph Title: Threads exit upon creation. · Issue #50 · etr/libhttpserver
X Title: Threads exit upon creation. · Issue #50 · etr/libhttpserver
Description: When running the server in gdb, I noticed that when using multiple threads, as soon as they are created they immediately exit, with the exception of the last one created. Here is the output of gdb when running your example hello_world.cp...
Open Graph Description: When running the server in gdb, I noticed that when using multiple threads, as soon as they are created they immediately exit, with the exception of the last one created. Here is the output of gdb ...
X Description: When running the server in gdb, I noticed that when using multiple threads, as soon as they are created they immediately exit, with the exception of the last one created. Here is the output of gdb ...
Opengraph URL: https://github.com/etr/libhttpserver/issues/50
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Threads exit upon creation.","articleBody":"When running the server in gdb, I noticed that when using multiple threads, as soon as they are created they immediately exit, with the exception of the last one created. Here is the output of gdb when running your example `hello_world.cpp`: \n\n```\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library \"/usr/lib/libthread_db.so.1\".\n[New Thread 0x7ffff525e700 (LWP 9992)]\n[Thread 0x7ffff525e700 (LWP 9992) exited]\n[New Thread 0x7ffff4a5d700 (LWP 9993)]\n[Thread 0x7ffff4a5d700 (LWP 9993) exited]\n[New Thread 0x7ffff425c700 (LWP 9994)]\n[Thread 0x7ffff425c700 (LWP 9994) exited]\n[New Thread 0x7ffff3a5b700 (LWP 9995)]\n[Thread 0x7ffff3a5b700 (LWP 9995) exited]\n[New Thread 0x7ffff325a700 (LWP 9996)]\n```\n\nI was looking through the source code, specifically this loop (https://github.com/etr/libhttpserver/blob/bb9f8b20626eb179ba0de79096f6fa60eff0cf16/src/webserver.cpp#L537), and noticed that you are handling the creation of multiple threads within libhttpserver. I was under the impression that libmicrohttpd handled the thread pool with the `MHD_USE_SELECT_INTERNALLY` flag and setting `MHD_OPTION_THREAD_POOL_SIZE` in the options list (the `va_args` parameter to `MHD_start_daemon`).\n\nI have verified that this is not an issue with my setup or libmicrohttpd by running the example in the libmicrohttpd docs with multiple threads, and they do not exit after creation.\n\nIf you need any more information, let me know!\n","author":{"url":"https://github.com/m-renaud","@type":"Person","name":"m-renaud"},"datePublished":"2014-05-01T00:20:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/50/libhttpserver/issues/50"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ee816986-7fd9-324c-a4be-21f572653aa3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD34:276C72:7707DC:9E44A0:6A530649 |
| html-safe-nonce | 4447d52d377ec46ec4db0347bc65c6501ab010a581ea9f4f6874d702ff43cc12 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDM0OjI3NkM3Mjo3NzA3REM6OUU0NEEwOjZBNTMwNjQ5IiwidmlzaXRvcl9pZCI6IjU4MjUxNTMyNDA3MDMxMDg2ODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | aecb4101fc612b0c6787a47e0decc470db6eabe80cb6b9ae0fee06444e4fe6d1 |
| hovercard-subject-tag | issue:32585959 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/etr/libhttpserver/50/issue_layout |
| twitter:image | https://opengraph.githubassets.com/afd8dbb2e5e7859010d6304c97e869573148ebb0fe0e0d4793c97c410ba93ed5/etr/libhttpserver/issues/50 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/afd8dbb2e5e7859010d6304c97e869573148ebb0fe0e0d4793c97c410ba93ed5/etr/libhttpserver/issues/50 |
| og:image:alt | When running the server in gdb, I noticed that when using multiple threads, as soon as they are created they immediately exit, with the exception of the last one created. Here is the output of gdb ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | m-renaud |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/etr/libhttpserver git https://github.com/etr/libhttpserver.git |
| octolytics-dimension-user_id | 1201536 |
| octolytics-dimension-user_login | etr |
| octolytics-dimension-repository_id | 3416891 |
| octolytics-dimension-repository_nwo | etr/libhttpserver |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3416891 |
| octolytics-dimension-repository_network_root_nwo | etr/libhttpserver |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width