Results 1 to 2 of 2

Thread: multithreading

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    50

    multithreading

    i've app with cca 30 runing threads (in the same time...). they all use global defined int array. but each change and use its own index of this array (100 %). do i have to place the code where the array is changing in each thread to critical section or anything else?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You only need to protect against it if >1 thread access the *same* data.

    If they only keep to the data in their own index in the array there's no need.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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