正在创建线程检查变量的好主意 [英] Is creating thread good idea to check variable
本文介绍了正在创建线程检查变量的好主意的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在用C ++开发服务,并在C#中开发GUI.
服务和GUI将通过INI进行交互,GUI中有一个选项可以在特定时间提供时间重新启动服务.
现在,在服务中,我必须不断检查用当前系统时间以INI编写的时间,并在时间匹配时重新启动服务.
为此,我应该创建一个线程吗?
I am developing a service in C++ and a GUI in C#.
The service and GUI will interact through INI, there is an option in GUI to give time restart service at a particular time.
Now in my service I have to continuously check the time written in INI with current system time and restart the service if time matches.
To do so, should I create a thread?
推荐答案
通常,Windows Task Scheduler提供了更好的方法来完成此类任务.
Usually the Windows Task scheduler provides the better way to accomplish such a task.
这篇关于正在创建线程检查变量的好主意的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文