0

Supposing there are 4 I/O workers in the use of I/O Completion Port corresponding to the number of processors, do they need synchronous access on client context among each other?

The client context here refers to what is passed through I/O CompletionKey. The problem can be that if worker A has post an I/O to I/O Completion Queue with context but is now changing the context. Worker B who is waken up to deal the I/O is reading the context at the same time. What would happen?

Y.Z
  • 626
  • 2
  • 9
  • 21

1 Answers1

0

You should synchronise access to the contents of your 'client context' using a critical section.

Len Holgate
  • 21,282
  • 4
  • 45
  • 92