Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #3714

About C++ and real-time OSs...

Path csiph.com!aioe.org!.POSTED!not-for-mail
From Ramine <toto1@toto1.net>
Newsgroups comp.programming.threads
Subject About C++ and real-time OSs...
Date Sun, 2 Apr 2017 17:13:20 -0400
Organization Aioe.org NNTP Server
Lines 38
Message-ID <obrphg$1jdh$3@gioia.aioe.org> (permalink)
NNTP-Posting-Host zB93FIixpUnU95xz14tmbQ.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
X-Mozilla-News-Host news://news.eternal-september.org:119
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.programming.threads:3714

Show key headers only | View raw


Hello,


I have been working on a queue with a condition variable, but
i have noticed that a condition variable does not work
correctly, because the threads must be waiting to be able
to be signaled, if they are not waiting the signal will be lost,
so the way that many are using a condition variable with
a FIFO queue is not correct, they are for example using
this logic on the consumer side:

  while(the_queue.empty())
         {
             the_condition_variable.wait(lock);
         }


and this is not correct, because if the_queue_empty() is true ,
and the last producer thread signals before the consumer
thread is waiting for the condition variable , so this will deadlock,
so i have avoided condition variables and i have designed and 
implemented an efficient real-time and thread-safe and bounded FIFO 
Queue and Stack an i am actually finishing them and they are working 
well, and i will soon posted them on internet.



Thank you,
Amine Moulay Ramdane.








Back to comp.programming.threads | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

About C++ and real-time OSs... Ramine <toto1@toto1.net> - 2017-04-02 17:13 -0400
  Re: About C++ and real-time OSs... Ramine <toto1@toto1.net> - 2017-04-02 17:31 -0400
    Re: About C++ and real-time OSs... Ramine <toto1@toto1.net> - 2017-04-02 18:09 -0400

csiph-web