From: Stephen Hemminger <stephen@networkplumber.org>
To: ciara.power@intel.com
Cc: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH] telemetry: detach pthreads
Date: Wed, 18 Aug 2021 19:38:19 -0700 [thread overview]
Message-ID: <20210819023819.1709957-1-stephen@networkplumber.org> (raw)
There are a number telemetry threads which are created and
there is nothing that does pthread_join() to wait for them.
Mark these threads as detached, so that the pthread library
can cleanup state when the thread exits.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/telemetry/telemetry.c | 2 ++
lib/telemetry/telemetry_legacy.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 8665db8d035b..976f0a21566e 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -490,6 +490,7 @@ telemetry_legacy_init(void)
pthread_setaffinity_np(t_old, sizeof(*thread_cpuset), thread_cpuset);
set_thread_name(t_old, "telemetry-v1");
TMTY_LOG(DEBUG, "Legacy telemetry socket initialized ok\n");
+ pthread_detach(t_old);
return 0;
}
@@ -528,6 +529,7 @@ telemetry_v2_init(void)
}
pthread_setaffinity_np(t_new, sizeof(*thread_cpuset), thread_cpuset);
set_thread_name(t_new, "telemetry-v2");
+ pthread_detach(t_new);
atexit(unlink_sockets);
return 0;
diff --git a/lib/telemetry/telemetry_legacy.c b/lib/telemetry/telemetry_legacy.c
index b7cd1bdd6c7b..8aba44d689b7 100644
--- a/lib/telemetry/telemetry_legacy.c
+++ b/lib/telemetry/telemetry_legacy.c
@@ -121,6 +121,7 @@ register_client(const char *cmd __rte_unused, const char *params,
close(fd);
return -1;
}
+ pthread_detach(th);
#endif /* !RTE_EXEC_ENV_WINDOWS */
return 0;
}
--
2.30.2
next reply other threads:[~2021-08-19 2:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-19 2:38 Stephen Hemminger [this message]
2021-08-20 8:49 ` [dpdk-dev] [PATCH] telemetry: detach pthreads Power, Ciara
2021-10-01 12:50 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210819023819.1709957-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=ciara.power@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.