delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2022/05/02/00:48:06

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20210112;
h=message-id:date:mime-version:user-agent:subject:content-language:to
:references:from:in-reply-to:content-transfer-encoding;
bh=59LYRkuigyVYqzbasTZ++Yi61XLXPOrvzqO53ECSm4g=;
b=i9wAzgXeMfV+4OHQGkGvY9wYiqyMOzd7t9ssL3ntPqSaP7aYndE+C/DHXocZmvlWBq
OWFJ4yZLI8QhWCXIa5K54Wp2KPYzJu+GRG2hUSSNGPyuqD/5+mSAcC2vKW+YnLG4Wx2v
7MzUMp5B4X2aJ4ZCyDkDbjKqalzNRPC2af82A53AvNtYjEYUzDuRI05idjsyd/RgpvE+
blrkCIsHAJKbpJO4YVudrZ4gMSSZwYFjw3j0J9vIagZndUzcRmM8zxqA1R1P9jvc3Pat
tONZt/zUDadfax36SeN1BuWstz+Y6+mZmeb0oY+HY0InAoo1uAkMf6gUq0IFPiMe/cJW
5i+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:message-id:date:mime-version:user-agent:subject
:content-language:to:references:from:in-reply-to
:content-transfer-encoding;
bh=59LYRkuigyVYqzbasTZ++Yi61XLXPOrvzqO53ECSm4g=;
b=Dn3O/NTeY7c/EoEscfCsZK51aVC29bVN/gDL6GGn6c4H9+X6WrwbzgmpHk2AJVELSL
kFowff7V0bn7CBC8Fpr/jMob8QnP7PKFTTLvoYhXi/DSHHxmhzIaMLBF2CWCLQgxucal
xmd5GK7l5SMNzIFWb3L9nybmDGS9kpCdeg2ga1b/Fo6PSTjiKspA3o7sNDIlC+zGmPza
vvZWlbu+AWIF17uVq4AsS7Xg6OZ254IqMVo6xW9arWnlfSVOBSiPJYo8reWRRMPAPaQ1
l/MCQOA6qwdCiIwk65/givOCDmPiOd0vNYZ6kzI9HZcbsaLWrmZzTRR8hctZK4Xmb/jT
pKZw==
X-Gm-Message-State: AOAM5325YNmDp+HyUD4Rw2bCVTBqM3E7QVZTD5AwK2yC8/fHv+LtHdQ/
ImfS3nzgEt7CIryKsX8jvJm6PlyJkw4=
X-Google-Smtp-Source: ABdhPJxSe6GLqqlS5dan6U5cWOoqmqyAofX8QdWT11+8RsgrkEYC01eKoYAg/XdQeQqAT96JyRjc3Q==
X-Received: by 2002:a05:6402:4383:b0:427:b18b:a1b with SMTP id o3-20020a056402438300b00427b18b0a1bmr8226202edc.80.1651466877629;
Sun, 01 May 2022 21:47:57 -0700 (PDT)
Message-ID: <e3969ae3-a0eb-82e5-3481-95178159a844@gmail.com>
Date: Mon, 2 May 2022 06:47:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.8.1
Subject: Re: GNU pth during djgpp build time?
To: djgpp AT delorie DOT com
References: <a52c077b-55b2-4a1f-877e-ebdcef7c1e01n AT googlegroups DOT com>
From: "J.W. Jagersma (jwjagersma AT gmail DOT com) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
In-Reply-To: <a52c077b-55b2-4a1f-877e-ebdcef7c1e01n@googlegroups.com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 2424m0o2028998
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 2022-05-02 05:49, janezz55 (janezz55 AT gmail DOT com) [via djgpp AT delorie DOT com] wrote:
> I know a port exists, but for all I know it's an add-on to an already existing djgpp install, so no <thread> header becomes available after installing it. But if pth could be built during build-time of djgpp, <thread> would become available. Does any build script (for linux) feature this? I tried to do the hack myself, but it took too much time. Maybe there's an alternative to GNU pth to get <thread>?
> 

Hi,

Installing GNU pth before building libstdc++ is an interesting idea, I might
experiment with that sometime.  If I ever get anywhere with that I'll let you
know.

Although, pth uses cooperative scheduling, so any existing code that you might
want to port (if that is your goal) will have to be modified to call
this_thread::yield() at regular intervals.

Another thought, when libstdc++ detects thread support then things like
std::shared_ptr will be accessed via mutexes, that overhead may be undesirable.

For now, I have std::thread and std::jthread implementations in my dpmi
library [0], you may find that useful.  It is cooperative like pth, but
pre-emptive scheduling could be implemented without much effort.  So far I
haven't had any use for that though.

[0] https://github.com/jwt27/libjwdpmi/blob/experimental/include/jw/thread.h

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019