登录 | 首页 -> 华新鲜事 -> 技术の宅 | 切换到:传统版 / sForum | 树形列表
C++ Guru, please help me....
<<始页  [1]  末页>> 

C++ Guru, please help me....I am doing a simulation using C++ (console application)
In the simulation, connection requests arrive following a poisson process.
I need generate connection requests and handle these requests.
Each time a request is generated, the request will be passed to a function for handling.


My problem is:
If a request was generated at time T1 , how to trigger a function at T1+T2 ? (T2 is a time instance and is poisson distributed).

"time" function can be used to get the current system time, then how to trigger a function at another time instance? What key C++ functions could be used?


I know how to handle this problem in WFC and Platform SDK since WM_TIMER messege is available.



Thank you very much!!!
[11:05pm (6-9 12:50, Long long ago)] [ 传统版 | sForum ][登录后回复]1楼

it's nothing with c++...u can read any simulation book which will include pseudocode for sigle process simulation. basic idea is generally insert the generated event in queue according to timestamp and process the event on the queue one by one[hula (6-9 18:07, Long long ago)] [ 传统版 | sForum ][登录后回复]2楼

(引用 hula:it's nothing with c++...u can read any simulation book which will include pseudocode for sigle process simulation. basic idea is...)Yeah!我也突然想起来了。谢谢哈。 [11:05pm (6-9 21:58, Long long ago)] [ 传统版 | sForum ][登录后回复]3楼


<<始页  [1]  末页>> 
登录 | 首页 -> 华新鲜事 -> 技术の宅 | [刷新本页] | 切换到:传统版 / sForum