http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.SyncObjs.TLightweightSemaphore.Create

http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.SyncObjs.TLightweightSemaphore.Create

Please simply explain to me the parameters of this constructor, especially first, AInitialCount.
http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.SyncObjs.TLightweightSemaphore.Create

Comments

  1. Stefan Glienke Ok, if I want threads to be given a semaphore so that they work when it's open (thread execute -> Semaphor.WaitFor) and I want to have as many threads as there are cores (+1 additional) then how should I create TLightweightSemaphore object?

    ReplyDelete
  2. What Primoz said at the end of the very first comment - put same value for both: TThread.ProcessorCount + 1

    ReplyDelete
  3. Stefan Glienke Primož Gabrijelčič Thanks

    ReplyDelete

Post a Comment