Link Details

Link 996833 thumbnail
User 225256 avatar

By mswatcher
via blogs.microsoft.co.il
Published: Jul 12 2013 / 09:23

Here’s a quick brainteaser for you. Suppose you really want to find all the prime numbers in a certain range, and store them in a List. And also suppose that you want to parallelize that calculation to make it as quick as possible. You then need to synchronize access to the list so that it’s not corrupted by add operations performed in multiple threads. Would it be better to use a C# lock (CLR Monitor) or a Windows mutex to protect the list of primes?
  • 7
  • 0
  • 791
  • 937

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Upvoters (7)



Downvoters (0)



    Apache Hadoop
    Written by: Piotr Krewski
    Featured Refcardz: Top Refcardz:
    1. Play
    2. Akka
    3. Design Patterns
    4. OO JS
    5. Cont. Delivery
    1. Play
    2. Java Performance
    3. Akka
    4. REST
    5. Java