1 Replies - 195 Views - Last Post: 02 August 2012 - 02:28 AM Rate Topic: -----

#1 scienalc  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 22-July 11

Does odd/even array access need concurrent handling?

Posted 02 August 2012 - 02:07 AM

Hi guys,
I have an array of structs and (for the time being) two threads which modify its elements. One thread is in charge of the even indexes, and the other of the odd ones.
Do I need in this case any locking/serialization? I think not, but just to make sure...
Is This A Good Question/Topic? 0
  • +

Replies To: Does odd/even array access need concurrent handling?

#2 Momerath  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 810
  • View blog
  • Posts: 1,951
  • Joined: 04-October 09

Re: Does odd/even array access need concurrent handling?

Posted 02 August 2012 - 02:28 AM

Not sure what serialization would have to do with this but you shouldn't need locking code. You'll need it if there is a possibility that the data structure would be altered by one of the threads (size change) or that two (or more) threads would be modifying the same data.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1