CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Threaded View

  1. #1
    Join Date
    Dec 2004
    Posts
    16

    Thread synchronization

    Ok, I know you have to synchronize access to variables that are shared between threads, but what about functions? Say, some sort of parse function that does not access any shared variables, would I need to synchronize access to that function too?

    This could be a problem too if I need to do that, because to save myself from alot of tedious coding, I wrote functions to call Enter/LeaveCriticalSection for alot of objects I use between threads. So far, I have not had any crashes or anything of the sort related to this, but it would be helpful to know so I can go over my code now and add the proper handling for them.

    Also, would I need to synchronize access to variables if im only reading the variable's data in the threads and not changing their value?

    Thanks!
    Last edited by Andreas Masur; February 1st, 2005 at 03:34 PM.

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

Featured