INDY 10 TCP Server - Combine with non thread safe VCL Code

后端 未结 3 1708
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-14 03:22

VCL is not thread safe. Therefore I guess it is not a good idea to write information to the gui in the INDY 10 TCP server.execute(...) function .

How t

3条回答
  •  孤城傲影
    2021-01-14 03:40

    Write stuff to the VCL thread from Indy the same way to write stuff to the VCL thread from anywhere else. Common options include TThread.Synchronize and TThread.Queue.

    Modifying a standalone TBitmap should not require synchronization with the main thread. You can modify it from any thread you want, as long as you do it from only one thread at a time. You can use the standard synchronization objects like critical sections and events to make sure only one thread uses it at a time.

提交回复
热议问题