From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 3CDC03858D39 for ; Mon, 1 Aug 2022 07:43:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3CDC03858D39 Received: by mail-pf1-x42e.google.com with SMTP id w185so9865825pfb.4 for ; Mon, 01 Aug 2022 00:43:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8UWv+P49FF0Rwr+hjEzFYaZ1i1hknFvJUxwCLoICWSo=; b=NH25aghGbqTKjxH4Sw7FXwuoPnwIsPsj8ZumozeEKz9BF5aSs5YuCCkmaLydTdyYzO TVX8NeeD9tKt0mnXlipEyT8jkUBlu0JB4QtU0Lboj2H3WWOk8WCEyB+mFc3RgaYgw/Bx LNIxbwN235uRghb0NMrHu4eJeanXgjh1++ZHDJ2+cRK8lO0E9QTvJNh5C3eOpk2wV9X5 H90w9AsFWgKJ44DjUzU0hhryxslDrJEebr4ilQ7yV7uc/GHQ0nOSsXzpEwQPTIYzj65h C14LTqFNy3e77xYUjZu05mjvuhA4TW8MkSol7l4TtomLztbreMgSbytG65UwDzfhPnM4 hfbQ== X-Gm-Message-State: AJIora+Y0no0DFzjWEskqqRgsYGuGDuN7TzPurt3kIeX3gjDjStFtCVZ bPi8sd4AXOFTGvEagtmtS0C/SqrDE0IIznpuOOc= X-Google-Smtp-Source: AGRyM1vuAh5bOBDZOzdgqJ/ihX5toBPOTu2dz5Es4oJ1Sv+ZLBG9NK1bEMUQyONNJTaZylc2L2A4Ea32Jhz0n+Gx5CQ= X-Received: by 2002:a63:4042:0:b0:411:bbfe:e736 with SMTP id n63-20020a634042000000b00411bbfee736mr12458757pga.1.1659339834103; Mon, 01 Aug 2022 00:43:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?Sm/Dq2wgS3LDpGhlbWFubg==?= Date: Mon, 1 Aug 2022 09:41:17 +0200 Message-ID: Subject: Re: pthread_mutex_timedlock() vs. clock_settime() To: Sebastian Huber Cc: libc-help@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Mon, 01 Aug 2022 07:43:57 -0000 Hi, At my opinion, if you do really parallelism you should make use of something like this: https://www.nongnu.org/gsequencer/api/4.2.0/libags/thread.html The AgsThread::run() function is what you usually override to run your parallel code. AgsConcurrencyProvider::get_task_launcher() can be used to run in conflict free context, without any parallelism. Your AgsTask implementation is launched while the tree is fully synchronize= d ... What I want to say is, parallelism is a complex topic and libags.so would provide abstraction to it. regards, Jo=C3=ABl On Mon, Aug 1, 2022 at 9:10 AM Jo=C3=ABl Kr=C3=A4hemann wrote: > > Hi Sebastian, > > You have a dead-lock, probably. I just looked at your code. You are > using non-recursive mutices and I think this mutex was locked twice by > the very same thread. > > Your code is buggy. > > regards, > Jo=C3=ABl > > On Mon, Aug 1, 2022 at 8:47 AM Sebastian Huber > wrote: > > > > Hello, > > > > I use the attached test program to check several POSIX functions which > > use an absolute CLOCK_REALTIME timeout. I noticed that the > > pthread_mutex_timedlock() with clock_settime() test cases doesn't work > > (it doesn't time out when the CLOCK_REALTIME is set past the time out > > time point). The test case works for the other synchronization objects, > > for example semaphores (sem_timedwait()) or condition variables > > (pthread_cond_timedwait()). I am not sure if this is a problem with my > > understanding of the POSIX standard, my test case implementation, or th= e > > glibc/Linux version. I use Linux 5.3.18. > > > > -- > > embedded brains GmbH > > Herr Sebastian HUBER > > Dornierstr. 4 > > 82178 Puchheim > > Germany > > email: sebastian.huber@embedded-brains.de > > phone: +49-89-18 94 741 - 16 > > fax: +49-89-18 94 741 - 08 > > > > Registergericht: Amtsgericht M=C3=BCnchen > > Registernummer: HRB 157899 > > Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thom= as D=C3=B6rfler > > Unsere Datenschutzerkl=C3=A4rung finden Sie hier: > > https://embedded-brains.de/datenschutzerklaerung/