From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: weird block on Get from basic protected bounded buffer with 2 tasks
Date: Tue, 12 Dec 2017 22:16:06 +0100
Date: 2017-12-12T22:16:06+01:00 [thread overview]
Message-ID: <p0pguk$tj3$1@gioia.aioe.org> (raw)
In-Reply-To: fdea6430-6fca-413b-a677-27a8f04e4a95@googlegroups.com
On 2017-12-12 20:08, George Shapovalov wrote:
> I thought might be prioritizing Gets would make it behave
Then the barrier must be
Count = 0 or else (Count < maxCount and then Get'Count = 0)
i.e. empty or else not full and no pending Get.
BTW, prioritizing is a bad idea. If you enforce entry order you also
increase possibility of context switches upon bulk buffer updates. If
one task makes several Puts and another does several Gets over an empty
buffer you may end up switching these tasks for each Put/Get pair. Which
defeats the very purpose of buffering. That is for a single core. For
multiple cores prioritizing would have no sense at all.
> So, what gives? Am I missing something here or is this a bug?
>
> The used platform: Gentoo Linux, gnat-gpl-2017, gcc-6.3.0
On some older platforms tasking must be kicked on, if I correctly
remember. E.g. by beginning the main with
delay 0.0;
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2017-12-12 21:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 19:08 weird block on Get from basic protected bounded buffer with 2 tasks George Shapovalov
2017-12-12 20:18 ` Jeffrey R. Carter
2017-12-12 20:55 ` George Shapovalov
2017-12-12 21:01 ` George Shapovalov
2017-12-12 21:16 ` Dmitry A. Kazakov [this message]
2017-12-13 9:25 ` George Shapovalov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox