1

I have tutorials on my university about cuncurrent programming. My task is to write a program based on semaphores in which a symmetric difference of two sets of numbers will be computed. I can't see where the concurrent programming is necessary. I understand that CP is about using same resources of data, but in which phase I should use two threads and semaphore. Semaphores are used to hold some process which may interfere the data, that are used by other process. I just don't see it.

Any ideas?

1 Answers1

0

The input sets are read-only, so your multiple threads will not step on each-others' toes (except maybe for memory bus contention), but you will need to synchronize your threads as they write into the result set.

Thilo
  • 257,207
  • 101
  • 511
  • 656