Self Suspending a thread in Delphi when it's not needed and safely resuming

前端 未结 3 1655
萌比男神i
萌比男神i 2020-12-19 05:20

This question involves Delphi and XE specifically deprecating Suspend and Resume. I have read other posts and I have not found a similar usage so far, so I’m going to go ahe

3条回答
  •  醉话见心
    2020-12-19 06:16

    There is a library to allow implementation of producer-consumer queue in Delphi using condition variables. This scenario is actually the example discussed.

    The classic example of condition variables is the producer/consumer problem. One or more threads called producers produce items and add them to a queue. Consumers (other threads) consume items by removing the produced items from the queue.

提交回复
热议问题