diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-28 17:08:17 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-28 17:08:17 +0100 |
| commit | f3f640b6bcf10ba463fc81cec97cfa212c520cfe (patch) | |
| tree | 94341752815b6b2d4c3a931be9b90c2c0f435baf /ot_udp.c | |
| parent | 18fcb27ec91f27789270550a2a005cb773bf2fe0 (diff) | |
Performance improvement, where it works: Let different udp worker threads have their own socket
Diffstat (limited to 'ot_udp.c')
| -rw-r--r-- | ot_udp.c | 7 |
1 files changed, 3 insertions, 4 deletions
| @@ -235,13 +235,12 @@ void udp_init(void) { | |||
| 235 | udp_generate_rijndael_round_key(); | 235 | udp_generate_rijndael_round_key(); |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | void udp_workers_install(int64_t sock, unsigned int worker_count) { | 238 | void udp_worker_install(int64_t sock) { |
| 239 | pthread_t thread_id; | 239 | pthread_t thread_id; |
| 240 | 240 | ||
| 241 | #ifdef _DEBUG | 241 | #ifdef _DEBUG |
| 242 | fprintf(stderr, "Installing %d workers on udp socket %ld\n", worker_count, (unsigned long)sock); | 242 | fprintf(stderr, "Installing a worker on udp socket %ld\n", (unsigned long)sock); |
| 243 | #endif | 243 | #endif |
| 244 | while (worker_count--) | 244 | pthread_create(&thread_id, NULL, udp_worker, (void *)sock); |
| 245 | pthread_create(&thread_id, NULL, udp_worker, (void *)sock); | ||
| 246 | } | 245 | } |
| 247 | 246 | ||
