From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id 450843848407 for ; Thu, 20 May 2021 11:09:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 450843848407 Received: by mail-lj1-x233.google.com with SMTP id e2so12894670ljk.4 for ; Thu, 20 May 2021 04:09:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1DYsXoLA7B+gZ/k6t4m6xLUsqKJtpvxbVDBY3XQCi0c=; b=qRatRHqJcVIvI06ZpF34Fz2UvWz7EaxRQgC49HSQ45ijtdSGsmJ6TXoDdUeT/hPQZE 3ZFMoB/8ToCEpNVh2ATZTGsSanIntX7Db3Szcni1tMcLWxFAi/U1c8nca7tQjKzAwCTl h4lksUR5yS94TrWMSHYQRZXDh4Vn9H/tx0Uev44Shd5vxllMP74L7YZ4oxuI2Dc9C0dY P9IGFqOGAfZwACFOv66M2zVUSO+GVTxLGoUDxNApj6CmYLqgYb6CuGMx5ZLCOsmytQIT Fem5/zHUMj5kP5R2XngIQv/1bXxQwmRrlsxvrEaFBhxfNYzEFuQ3J/FLLCw1tRjepX7p PxiQ== X-Gm-Message-State: AOAM530UbluKvvT6FTRkg3FC4Qd2cdIWS4KHrDjLUT56A2VOTaqx6NaI y3XHUYGLZuBq0zuDDcZALyem4UOM/2zkysDap/k= X-Google-Smtp-Source: ABdhPJxj8wLNVsglVFggE/LdecZ8DGsoZB5GlMZwYidu5sfoefMxCZXbzGv5+aE2h+rLBrm/FBnf8OIUJzttoZMxvt0= X-Received: by 2002:a2e:9b45:: with SMTP id o5mr2760837ljj.153.1621508983815; Thu, 20 May 2021 04:09:43 -0700 (PDT) MIME-Version: 1.0 References: <877djtsm5h.fsf@oldenburg.str.redhat.com> In-Reply-To: <877djtsm5h.fsf@oldenburg.str.redhat.com> From: Alexandre Bique Date: Thu, 20 May 2021 13:09:27 +0200 Message-ID: Subject: Re: Yield to specific thread? To: Florian Weimer Cc: Alexandre Bique via Libc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2021 11:09:48 -0000 On Thu, May 20, 2021 at 1:03 PM Florian Weimer wrote: > > * Alexandre Bique via Libc-help: > > > Ideally I'd like to do: > > A produces a request > > A sched_yield_to(B) > > B processes the request > > B sched_yield_to(A) > > This looks like an application for a condition variable or perhaps a > barrier. If there is just a single writer, the kernel should wake up > the desired thread. I don't think conditions or barriers would solve the problem. Because they would just put the waiting threads on the wake up queue like the read() on the pipe would.