From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <283f5df10612061436i5179e5f7mc7930ebf1f3ec280@mail.gmail.com> Date: Wed, 6 Dec 2006 17:36:19 -0500 From: "LiteStar numnums" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] OT: cannonical set of queue ops In-Reply-To: <676c3c4f0612060835x414a779ao6e1f5fcbe021aba9@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <15215407ef3dbfddfed3946505e2dc78@quintile.net> <676c3c4f0612060835x414a779ao6e1f5fcbe021aba9@mail.gmail.com> Topicbox-Message-UUID: ebdd4882-ead1-11e9-9d60-3106f5b1d025 >For instance, if IsQueueEmpty returns "true", that answer isn't worth very much if, by > the time you act on that information, some other thread could have > added an item to the queue. Wouldn't it be natural for such a function to block the active thread until the desired result is achieved? Since this clean up thread wouldn't really need to be on a hard deadline, wouldn't WaitQueueEmpty make more sense then a IsQueueEmpty? The writer may be more difficult, but again, if the Queue is full, it must wait anyway, so blocking here wouldn't be too problematic, methinks. --=20 If work and leisure are soon to be subordinated to this one utopian principle -- absolute busyness -- then utopia and melancholy will come to coincide: an age without conflict will dawn, perpetually busy -- and without consciousness. -- G=FCnter Grass