Re: [問題] 在不同process間使用callback function
※ 引述《chengcti (卡馬請出來面對!!)》之銘言:
: 1. IPC / mailslot, pipe, message.
: not easy
: 2. file share (a simple method)
: A, B always check a file every n secs.
: When C writes a flag to file.
: The A & B read it, and call his function.
I recommand the original author to use dll
shared memory.
It doesn't get the drawback of frequently file I/O
as you described above.
Shared memory can be mapped to a different address in
each process. For this reason, each process has its own
instance of memory pointer, which is declared as a global
variable so that it is available to all DLL functions.
You can integrate the memory content and callback funcitons
together, to achieve your purpose.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.141.39.249
推
12/29 20:31, , 1F
12/29 20:31, 1F
推
12/29 23:27, , 2F
12/29 23:27, 2F
→
12/30 00:22, , 3F
12/30 00:22, 3F
→
12/30 11:46, , 4F
12/30 11:46, 4F
→
12/30 11:47, , 5F
12/30 11:47, 5F
→
12/30 13:46, , 6F
12/30 13:46, 6F
→
12/30 13:47, , 7F
12/30 13:47, 7F
→
12/30 13:47, , 8F
12/30 13:47, 8F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章