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


Groups > comp.programming.threads > #1918

Re: There is a solution to satisfy the energy efficiency requirement

From aminer <aminer@toto.net>
Newsgroups comp.programming.threads, comp.programming
Subject Re: There is a solution to satisfy the energy efficiency requirement
Date 2013-10-12 19:28 -0700
Organization albasani.net
Message-ID <l3clup$vun$1@news.albasani.net> (permalink)
References <l3ck10$t7b$1@news.albasani.net>

Cross-posted to 2 groups.

Show all headers | View raw


On 10/12/2013 6:55 PM, aminer wrote:
> if self.count=0
>             then
>              begin
>                self.event.waitfor(INFINITE);
>                self.event.resetevent;
>              end;
>          end;


This method doesn't work , cause if a thread1 was on
"self.event.waitfor(INFINITE)" and another thread2 corossed
the "if self.count=0" , and if thread2 has not arrive yet to 
"self.event.waitfor(INFINITE)" , and  thread1 has
received two setevent() from the push() method and it has called after
that  "self.event.resetevent" , so thread2 will stop and wait
on "self.event.waitfor(INFINITE)" even if there is  items in the queue, 
so this is a problem.



I will still think more about a method to satisfy the efficency 
requirement without using SemaCondvar or Semaphore cause they are slow.



Thank you,
Amine Moulay Ramdane.






Back to comp.programming.threads | Previous | NextPrevious in thread | Find similar


Thread

There is a solution to satisfy the energy efficiency requirement aminer <aminer@toto.net> - 2013-10-12 18:55 -0700
  Re: There is a solution to satisfy the energy efficiency requirement aminer <aminer@toto.net> - 2013-10-12 18:57 -0700
  Re: There is a solution to satisfy the energy efficiency requirement aminer <aminer@toto.net> - 2013-10-12 19:28 -0700

csiph-web