From: Bagas Sanjaya <bagasdotme@gmail.com>
To: "Dr. Henning Kopp" <hkopp22@yahoo.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Power Management <linux-pm@vger.kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Alan Stern <stern@rowland.harvard.edu>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: Why does Linux not implement pthread_suspend() and pthread_resume()?
Date: Sun, 14 Jan 2024 21:10:29 +0700 [thread overview]
Message-ID: <ZaPrVWwqkHMj3Bpp@archie.me> (raw)
In-Reply-To: <0219492d-3971-f8e0-8b46-22d442a2d442@yahoo.de>
[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]
[also Cc: linux-pm people]
On Sun, Jan 14, 2024 at 12:20:04PM +0100, Dr. Henning Kopp wrote:
> Hi everyone,
>
> I have a question regarding pthreads. In particular, I was wondering why
> there is no way to suspend and resume a thread in Linux.
>
> In Windows, there is SuspendThread() and ResumeThread() from
> processthreadsapi.h. However in Linux, there does not seem to be a similar
> function in pthread.h.
>
> When researching this issue i found multiple ways to work around the
> inability of suspending a thread, such as using mutexes. But my question is
> why nobody bothered implementing suspending/resuming threads.
>
> I found one answer on stackoverflow [1] that mentions that pthread_suspend
> and pthread_resume_np is in the "Unix specification", but not implemented in
> Linux. I tried to follow up on this hint and get access to the Posix spec,
> but i am not affiliated with a university anymore, so i was unable to
> download the spec.
>
> I read "man 7 pthreads". It mentions that there are two Linux
> implementations of Posix threads, that differ in some details from the Posix
> spec. However, it does not mention suspending or resuming threads at all.
LinuxThreads and NPTL?
>
> I hope this is the right mailing list for my question. If it is off-topic,
> please accept my apologies.
>
> So my question is: What is the reason that Linux does not implement
> functions for suspending and resuming threads?
>
Confused...
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next parent reply other threads:[~2024-01-14 14:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0219492d-3971-f8e0-8b46-22d442a2d442.ref@yahoo.de>
[not found] ` <0219492d-3971-f8e0-8b46-22d442a2d442@yahoo.de>
2024-01-14 14:10 ` Bagas Sanjaya [this message]
2024-01-15 2:20 ` Why does Linux not implement pthread_suspend() and pthread_resume()? Alan Stern
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=ZaPrVWwqkHMj3Bpp@archie.me \
--to=bagasdotme@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hkopp22@yahoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rafael@kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=tglx@linutronix.de \
--cc=ulf.hansson@linaro.org \
--cc=viresh.kumar@linaro.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