使用C ++在Linux和Windows机器上调度任务 [英] Scheduling Task in using C++ On linux and Windows machine

查看:198
本文介绍了使用C ++在Linux和Windows机器上调度任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网关模拟器应用程序应用程序。网关流视频到客户端.Gateway模拟器可以模拟1000网关。用户可以发出命令,如开始录制1小时后,记录长达1小时或可能



此网关将在Windows和linux上运行。
这里对于1000网关,可以有1000这样的请求从用户。需要保存此计划这个任务,以便它可以执行后。我想知道如何实现这个。



我使用QT4以及C ++为这个应用程序。
这里我不能使用任何其他第三方库。



如何在C ++或QT中实现此功能

> QTime 和 QTimer




  • 简单:根据现在和事件时间之间的差异,为每个预定事件启动一个计时器

  • :维护一个事件的容器,并为第一个事件启动1个计时器。


I am working on Gateway Simulator Application application.the gateway Streams the video to the client.Gateway Simulator can simulate the 1000 gateway.a user can issue the command like start the recording after 1 hour and record upto 1 hour or may be strem the video at 5'oclock.So basically scheduling the task.

This gateway will run on both windows and linux. Here for 1000 gateway there can be 1000 such request from the user.There need to save this schedule this task some where so that it can executed later.I wanted to know how to implement this.

I am using QT4 along alongwith C++ for this application. Here I can't use any other third party lib .

How to implement this features in C++ or QT

解决方案

In QT, scheduling can be done with QTime and QTimer.

  • Simple: start a timer per scheduled event based on the difference between now and event-time
  • more scalable (1000 requests): maintain a container of events and start 1 timer to the first event.

这篇关于使用C ++在Linux和Windows机器上调度任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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