Re: [Mono-list] How consistent are exceptions?

2013-02-19 Thread xplicit
About exceptions. Exceptions messages in .NET depends on locale, so if you're going to run your soft in various countries and want to compare exception's message strings you'll have to compare with all localized messages (or try to workaround with changing CurrentUICulture of exception handling

Re: [Mono-list] How consistent are exceptions?

2013-02-13 Thread Alan
This approach will not work. You may not get an exception, you may just end up looping forever inside the dictionary. This is not a theoretical issue, it is something which does happen in the wild when you mutate a dictionary while iterating it. Alan On 13 February 2013 16:08, edward.harvey.mono

Re: [Mono-list] How consistent are exceptions?

2013-02-13 Thread edward . harvey . mono
From: Alan [mailto:alan.mcgov...@gmail.com] This approach will not work. You may not get an exception, you may just end up looping forever inside the dictionary. This is not a theoretical issue, it is something which does happen in the wild when you mutate a dictionary while iterating it.

Re: [Mono-list] How consistent are exceptions?

2013-02-13 Thread Bob Davies
Edward - build a queue of updates, have the iterating thread review the queue at the end of an iteration, then have the iterating thread do the updates and start anther iteration. Bob Davies ___ Mono-list maillist - Mono-list@lists.ximian.com

Re: [Mono-list] How consistent are exceptions?

2013-02-13 Thread Alan
You could do it with a ConcurrentDictionary and a 'serial' as you've described. ConcurrentDictionary makes it safe for you to read and write simultaenously, the serial lets you bail out of your iteration when the dictionary is modified. Another alternative is to clone the entire dictionary every