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. Visual Basic
  4. Synchronizaiton (Multithreading)

Synchronizaiton (Multithreading)

Scheduled Pinned Locked Moved Visual Basic
csharp
3 Posts 3 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.
  • M Offline
    M Offline
    Muhammad Fahim Baloch
    wrote on last edited by
    #1

    I make a software in vb.net which is used multithreading I want to Synchronization of threads so that multiple thread cannot be able to access same code at the same time ................ Thanx!!!!!

    D A 2 Replies Last reply
    0
    • M Muhammad Fahim Baloch

      I make a software in vb.net which is used multithreading I want to Synchronization of threads so that multiple thread cannot be able to access same code at the same time ................ Thanx!!!!!

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Without all the description that a question like this needs to be clear, I think you may need to look into using a SyncLock.

      ' Locks a section of code so only one thread can run it at a time
      SyncLock lockObject
      ' Code
      End SyncLock

      The documentation on SyncLock can be found here[^]. The hardest part about using it is picking an appropriate object to use for the lock.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      1 Reply Last reply
      0
      • M Muhammad Fahim Baloch

        I make a software in vb.net which is used multithreading I want to Synchronization of threads so that multiple thread cannot be able to access same code at the same time ................ Thanx!!!!!

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        By "Same code" I assume you mean the same variable- each thread has its own copy of the code. Take a look at synclock, that does what you need.

        Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

        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