Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp3278539rdd; Sun, 14 Jan 2024 03:18:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxKaw4meBfoZ1ou6rtrnZwPpVbd+1gfxxLr/gYZnU0YwFjyl16PQaUrPAIXcx/Pr5XihyC X-Received: by 2002:a17:906:30cd:b0:a2d:423a:721b with SMTP id b13-20020a17090630cd00b00a2d423a721bmr763054ejb.69.1705231089160; Sun, 14 Jan 2024 03:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705231089; cv=none; d=google.com; s=arc-20160816; b=gpDJCFQkq4pSxhxkrb0J1OvvIHptJoAKj8SABu8pjbWRWsHT7VKGDzDYAhKLOAIwM+ pg+4qMb4A1ZCtxb2KxhNTF5cLsaCLjGazE1JfM+xmSr+DHdFujGAy6TVq5HzQEyS7UOp OgPM406c/jIF03sCNWip4089I3q6oBsklOq+4cRg2oEIwQWJ6Uh31ZTDFrmq9cbHxJbG fL4aQUhRk2Q2PCC8tlKVi6CmbYnmq+hUjyH80vK2v42V30hAGylby/kKwvFMgUS+hrFT ocNDx/chqxOqPZzi9lQft3PO75faWNgF947p2r9mjcwbb8Y5jM73eNhCucvEQbEMijJO Q++w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:content-transfer-encoding:to:content-language:subject :from:user-agent:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:date:message-id:dkim-signature; bh=PPUeWA3hsgKvXXfk+8EK6nK6N40f1RHcnTddCLgPkz8=; fh=V9AeBafJgTW96HdC48wsxGAfd7Fe9P2uAL8tLCjpUN4=; b=I+qoiMihl1LmMjDUK0mq0timIyL69xRqO3jHvd5Mn4HsiFqHbokAySqfYA5cQbke7s xwuBkTdADkXiux3IowgSHr0WxFMZ/99x/brIkmoUk2fbD6mTtJ+59i9yXVBZt+CcuCnT GWG+l27apZJZVZ+EZu/TVMkCuY/Y+jgI0+MAi8lTrS1qI2Ys6We+EetYZJ1MfemIq9Rb 6peyiZhp6bEuOskpixcqJXK++LNoWfTrz8JtJvN8sMP6vnEAge4kPUQ8Yq1UkFAmsjyk u2Et4zwTIhlbHRJyQn7nx0dbnPdSG74IJ04oxdpJYd7UGdPPU+hglWmQzqbhMoocii4B x+/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.de header.s=s2048 header.b=UiCNCxTE; spf=pass (google.com: domain of linux-kernel+bounces-25449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id um6-20020a170906cf8600b00a26e35b7a55si2936711ejb.742.2024.01.14.03.18.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 03:18:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.de header.s=s2048 header.b=UiCNCxTE; spf=pass (google.com: domain of linux-kernel+bounces-25449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DC9911F21877 for ; Sun, 14 Jan 2024 11:18:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 916022107; Sun, 14 Jan 2024 11:18:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.de header.i=@yahoo.de header.b="UiCNCxTE" Received: from sonic314-19.consmr.mail.ir2.yahoo.com (sonic314-19.consmr.mail.ir2.yahoo.com [77.238.177.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B85B77E for ; Sun, 14 Jan 2024 11:17:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yahoo.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1705231078; bh=PPUeWA3hsgKvXXfk+8EK6nK6N40f1RHcnTddCLgPkz8=; h=Date:From:Subject:To:References:From:Subject:Reply-To; b=UiCNCxTETCEVuP3tWpeGBaJO06XY7iHoDSyaCVqbA/4mGI1M72ryLW7+09yUR+wwezf2lKYjIJ9QnzU3io1wT8tsoupMUDkjJ11Z9XKvqDSxi1vZfI1PmAMopXlgiFWlwIeUr0Brk8gehBNpstByzHa0oi2BjrxO4Xfzz0nRlmV+ZY94CiVeqd18P5Miolf/5zzI1FzGV+7Sx53COX583c/LO+dshE2OzaacnQQVhoXi/87us8P760zDq6y6a2wc5+e1W65fi32doSphd6gYusxwtc+7WH8Cxe+b2cDVmRlKgZtYbYQn0IRQ3EYCX0+1WailGN2m4i+N/xOl7tOL3w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1705231078; bh=y59RtRxc6xwc8c3SWC2EdcnsS/EQv4dqB3DsB/uj4mz=; h=X-Sonic-MF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uAL9loF8CmWiOAx4F4bF GxRWl.dYKKn8N1EX4kHjlNJidE6z4znUVhGWkXBJfD5Z8z.nIy3RrCMBOVE1_NcetC5eogg.sPH0 Hiq6R4pYn1DdE1E9.y4Ch.0sH0cXoNTZb0yYf86yx95VWNF9OmjinCfKLfe6r8n1GxwunWr4cK9f b0a5WzxC5SshFWXZq8eWYSm6l_M4pO5yMAKAmEu4Bcl0yr9MPfzI5WqcZXTaydGedFxVMSG7g3LD hBUOvtFYf87etfubShVnopMzEmj1B07A6MP8XTjM0Z26VOK3MLj3qSEx9daSxLgWa1PMGi6Yhm9s 5BJ0MmglMAf4kn1F9jNbc_b.2_SicM1POe5LrJJqu7rtdtEsEEtwg4TTPl40r3n9ao8i19nxZCv1 o8GhogDQzb.tCUmNcg8fvQZoSJd4zE7h8ofrtPMpFkJqfaHeza1Sf6oHM_rH7pEbe6u_KUkziaSt a7eOSiUF7Nog- X-Sonic-MF: X-Sonic-ID: 91b2a64e-0248-42fe-a33f-4a6d1369e878 Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ir2.yahoo.com with HTTP; Sun, 14 Jan 2024 11:17:58 +0000 Received: by hermes--production-ir2-7cc8d8ff75-p5cgp (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 2b92f031ec94ccfe06fcd93c95fb275f; Sun, 14 Jan 2024 11:17:55 +0000 (UTC) Message-ID: <0219492d-3971-f8e0-8b46-22d442a2d442@yahoo.de> Date: Sun, 14 Jan 2024 12:20:04 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 From: "Dr. Henning Kopp" Subject: Why does Linux not implement pthread_suspend() and pthread_resume()? Content-Language: en-US To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit References: <0219492d-3971-f8e0-8b46-22d442a2d442.ref@yahoo.de> X-Mailer: WebService/1.1.22010 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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. 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? Best regards Henning [1] https://stackoverflow.com/questions/11468333/linux-threads-suspend-resume/13399592#13399592