From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFA2DC433FF for ; Mon, 29 Jul 2019 18:01:52 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7746320C01 for ; Mon, 29 Jul 2019 18:01:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jlthXl77" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7746320C01 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92) (envelope-from ) id 1hs9xj-00088G-M3; Mon, 29 Jul 2019 14:01:31 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1hs9xh-00088A-SZ for kernelnewbies@kernelnewbies.org; Mon, 29 Jul 2019 14:01:30 -0400 Received: by mail-pg1-x536.google.com with SMTP id i18so28637960pgl.11 for ; Mon, 29 Jul 2019 11:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=t19RObbd7Qk/fl617pcK4lx9Dzx5GcCWBLDTxlJ5EhU=; b=jlthXl77BoHvBknBXHSRIVMHqpzeUR4mBnY3aTtsxY51amCwuc5DbosswF9bwtmYvy x/RFBmDX2QeW/vA2SwjJGabjUBzz54DU2tvDcb/I9AeLdDFLgqWkvJrCDpIWZuaO88cU Ozvv5iCYcflBXkK8NdZXkg2V1808AXEJUy1kL8xF08yPfWnkBU3dBlC+HRVWY2znTCiy 42Ww26Gq+FzSPk50Nl5d1w/8u8/noXIHByTtsjAvenJ6+4yVxKxZIyHTigXrbLSYy2sK HbTaWhcYT54kne/ULRbFFSnHVt99G5N9v1X++AUz9f3m6vOKptblXhfYJd1/C1pW8dhS XLFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=t19RObbd7Qk/fl617pcK4lx9Dzx5GcCWBLDTxlJ5EhU=; b=CxVTH0glFQCCkDWeZKUi9q8ohEJlD7/cJUbeNOV5AVMq2oo0Qi7SWuprqSvLYXBC+J nJ37ILkqhnk2Wr6+efIkFh6qr8wOQxJrJ8+YWZXat3g8Bcyy91AmS6OznhkKRBnEJTVw iZpYYbX0v+b0lRV90AYvsmaD7+1WySdzYbpwMUkB50WEz0UlvaHXNBkfFrBu46Ed9/Cy GWxCYsjCAtBXki8pnglatUKQOOV2km0xCRcvkGnG12/5p8iiurBeMa3gOgXeZ4fGQePq 3YBt7PxcdN7rX9X8ZyDbG6PM4plU0YMaKDe5BLzHiktQnz1UDcGIOsH/36hAoiY4Pxt2 PdSg== X-Gm-Message-State: APjAAAWBw5piIAg6X6CE6l+iP5Ofvt2qFAACiHTYO234ywszLl8DVuds CtoMXdkmvam6OLcG+lBXbyQ= X-Google-Smtp-Source: APXvYqwLKvx9ZC4cXzCiYPCMphiFJtnvs/L532gsfmQVD2iS3PoDxBaYNYMdR98oaDuLuVk6f5ITvA== X-Received: by 2002:a63:1341:: with SMTP id 1mr21047403pgt.48.1564423288497; Mon, 29 Jul 2019 11:01:28 -0700 (PDT) Received: from bharath12345-Inspiron-5559 ([103.110.42.34]) by smtp.gmail.com with ESMTPSA id p26sm10464521pgl.64.2019.07.29.11.01.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jul 2019 11:01:27 -0700 (PDT) Date: Mon, 29 Jul 2019 23:31:23 +0530 From: Bharath Vedartham To: Muni Sekhar Subject: Re: wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up() Message-ID: <20190729180122.GA11403@bharath12345-Inspiron-5559> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Mon, Jul 29, 2019 at 10:48:57PM +0530, Muni Sekhar wrote: > Hi All, > > Let us assume that multiple processes are waiting on wait_event()\ > wait_event_interruptible()\ wait_event_interruptible_timeout(), which > process gets woken up on calling wake_up()?? > > I presume wake_up() picks one process, but is there any algorithm to > pick which process? > > > -- > Thanks, > Sekhar Sorry to spoil the fun here. But check out what the queue data structure is all about. 'wait_queue' :) Thank you Bharath > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies