Results 1 to 3 of 3

Thread: Understanding SyncLock statement...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    Palermo, Italy
    Posts
    325

    Understanding SyncLock statement...

    I Have a multithread application. Those all threads (depending on the connections number) append a text string to a text file, for instance a Log file. How do I syncronize them?
    Thx
    Xmas.
    Learn, this is the Keyword...

  2. #2
    Lively Member
    Join Date
    Feb 2003
    Location
    UK
    Posts
    95

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I didn't check the link so it may explain it but the idea is that you don't want to an object to be changed at the sametime in two different threads. So if you perform an operation that requires a resource that the thread needs sole access to you can use SyncLock to have other threads halt or have only one thread access it at a time. It is 'locked' by that thread until its finished at which time other threads can go about their business.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width