public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ulatekh at yahoo dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug librt/28799] [Feature request] Enhanced timer_create()/timer_delete(), for MS Windows parity
Date: Fri, 21 Jan 2022 17:14:29 +0000	[thread overview]
Message-ID: <bug-28799-131-1L9sB0NFOt@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28799-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28799

--- Comment #2 from Steven Boswell II <ulatekh at yahoo dot com> ---
Although my limited testing shows that, indeed, this allows the timer to get
shut down cleanly, it reveals another problem.

Apparently, in the Linux implementation, a new thread is created (and quickly
destroyed) for every invocation of a callback-based timer, accompanied by a
flood of "New Thread" and "Thread exited" messages in my gdb window. (The timer
in question is invoked 40 times per second.)

My reading of glibc's sysdeps/unix/sysv/linux/timer_routines.c concurs;
timer_helper_thread() repeatedly invokes pthread_create() on
timer_sigev_thread(), which runs the timer callback once and then exits.

So thanks for your help, but I'm just going to go back to my hand-rolled
thread-based timer implementation, which creates a thread per timer, not a
thread per timer-invocation.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-01-21 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 15:32 [Bug librt/28799] New: " ulatekh at yahoo dot com
2022-01-20 16:51 ` [Bug librt/28799] " fweimer at redhat dot com
2022-01-21  8:37 ` fweimer at redhat dot com
2022-01-21 17:14 ` ulatekh at yahoo dot com [this message]
2022-03-01 13:16 ` fweimer at redhat dot com

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=bug-28799-131-1L9sB0NFOt@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).