如何在不使用全局变量的情况下在多线程中增加计数器 [英] how to increment counter in multithreading without using global variable

查看:243
本文介绍了如何在不使用全局变量的情况下在多线程中增加计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生,

我是delphi7的新手。使用多线程。

其中我想对所有线程使用通用计数器,并通过任何一个线程更新该计数器,并且可以通过另一个线程获取新的更新计数器值。



但不使用全球计数器Var



如何做到这一点..

请帮帮我..

谢谢你,

Respected sir,
I am new in delphi7. working with multithreading.
in which i want to use common counter for all threads and updated that counter by any one thread and fresh updated counter value can be fetched by another thread.

but without using global counter Var

how to do this..
please help me..
thank you,

推荐答案

这篇关于如何在不使用全局变量的情况下在多线程中增加计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆