Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. ReaderWriterLock [modified]

ReaderWriterLock [modified]

Scheduled Pinned Locked Moved .NET (Core and Framework)
question
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hendrik Debedts
    wrote on last edited by
    #1

    By using this, what exactly is locked? A specifiek variable or the thread itself or the variables that have been modified with 'System.Threading.Interlocked.Increment'? I THINK 'THE VARIABLES THAT HAVE BEEN MODIFIED BY THE THREAD'. WRIGHT? If you have the following: public static void Synchronization_WriterLock() { System.Threading.ReaderWriterLock oReaderWriterLock; oReaderWriterLock = new System.Threading.ReaderWriterLock(); miCount = 0; try { oReaderWriterLock.AcquireWriterLock(100); try { System.Threading.Interlocked.Increment(ref miCount); Console.WriteLine(miCount); } finally { oReaderWriterLock.ReleaseWriterLock(); } } catch (ApplicationException e) { Console.WriteLine("Failed to get a Writer Lock"); } } What locks what? -- modified at 17:03 Wednesday 27th December, 2006

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups