From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 321BA3856944; Fri, 16 Jun 2023 02:23:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 321BA3856944 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686882217; bh=yd1+Ju7QiDKddxR61gstUPIcwZF/lPjCX0C3epgMiDA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qd+aIPXll0+58QpZftsJ2eqN0RFVLKyQbyf2dUBU7zxChuD3jErcAuMWTZhQwnJN2 8em53grvIp3cUouZmO7ODKX7t2n2EmNEjfIn0mUqOKHf8h9onvf9Q56LXF97+uIMu0 LIJLfF3wwxI3HxJJHirMziwmRV62m/fyjeh3jfcI= From: "stsp at users dot sourceforge.net" To: glibc-bugs@sourceware.org Subject: [Bug libc/30558] SIGEV_THREAD is badly implemented Date: Fri, 16 Jun 2023 02:23:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.37 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stsp at users dot sourceforge.net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30558 --- Comment #2 from Stas Sergeev --- (In reply to Adhemerval Zanella from comment #1) > One possibility is to remove the background thread, create the thread pri= or > to timer_create, You mean, at timer_create()? Or do you mean 1 thread per all timers? > and move the sigwaitinfo loop logic to the thread itself.=20 > It would require changing how timer_delete works, it needs now to signal = the > thread instead to issue the syscall itself. Btw this is how musl has > implemented it. >=20 > I am not sure which is the best option, but it might worth experimenting = to > remove the helper thread. It would allow removing the > __timer_active_sigev_thread list and simplify the code, but I am not sure > about the performance implications. I would guess the performance effect may be non-linear. For example on a low timer rate maybe currently you save a syscall or 2 so things are fast. On a higher rate you may get increased loadavg because of the periodic thread re-creation, and on a yet higher rate this may start manifesting in a degraded performance of the entire system, not just 1 prog. I can try to play around this and measure things out, but eg pid reuse problem also bothers me a lot, i.e. I don't want my prog to loop over the pid space indefinitely. Who knows what system-wide problems will that create. I've yet to see the program that constantly runs over the pid space, so may I assume SIGEV_THREAD just rarely used so no one cared before? --=20 You are receiving this mail because: You are on the CC list for the bug.=