Re: Djikstra counting semaphore in c# for your review

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: TT (Tom Tempelaere) (_|\|_0$P_at_|/\|titi____AThotmail.com|/\|@P$0_|\|_)
Date: 06/25/04


Date: Fri, 25 Jun 2004 08:40:03 -0700


"TT (Tom Tempelaere)" wrote:

> "William Stacey [MVP]" <staceywREMOVE@mvps.org> wrote in message
> news:eIDrO2bWEHA.1000@TK2MSFTNGP12.phx.gbl...
> > Update to the code? I did post a few changes after the first post. Let
> me
> > know what updates you would like to see.
> > --
> > William Stacey, MVP
>
[...]
> I think you should introduce Debug.Assert's at specific places for several
> reasons, which is my opinion and perhaps a question of style (or QOI).
[...]
> * Asserts could reveal nasty sneaky threading issues (because code execution
> isn't linear anymore). Throwing pulls you out of the context in which the
> state-error occured.

The only sad thing about Debug.Assert's in MT code is that they may trigger from multiple threads and that can become messy if one assert is directly followed by another from another thread.

[...]

Cheers

--
Tom Tempelaere.


Relevant Pages

  • Re: Djikstra counting semaphore in c# for your review
    ... "TT (Tom Tempelaere)" wrote: ... I did post a few changes after the first post. ... > I don't understand the use for TryRelease. ... This is analoguous to TryEnter from the .NET Monitor class. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Djikstra counting semaphore in c# for your review
    ... I did post a few changes after the first post. ... > William Stacey, MVP ... Tom Tempelaere ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Default/editable string to raw_input
    ... This is my first post to the list, I hope somebody can help me with this ... Apologies if it has been posted before but I have been internet ... The config file consists of a number of keys, eg. build number, target ... really shouldn't be doing console I/O from multiple threads anyway). ...
    (comp.lang.python)
  • Re: 2 cells on multiple pages onto 1 page
    ... When you want to edit your post, just reply to your own first post and ... add/delete information. ... That way it stays in one thread so you don't get multiple threads going with ...
    (microsoft.public.excel.worksheet.functions)