(. Effo EDIT , ) , .
, UI .
, UI.Q . . , : , - , ( UI.Q C/++).
, UI.Q , . , posix. posix, . . , . , , , .
. , .
. EffoNetMsg.pdf http://code.google.com/p/effonetmsg/downloads/list, , .
Effo EDIT @2009oct23: , , .
+---------------+
+---> Ring Buffer-1 <---+
| +---------------+ |
+--+ +-----+
| | +---------------+ | |
| +---> Ring Buffer-2 <---+ |
| +---------------+ |
| |
+-------+-------+ +-----------+----------+
| Push Msg & | | GetHeadTail() |
| Send AckReq | | & Send UpdateReq |
+---------------+ +----------------------+
|App.MsgStage() | | App.DisPlayStage() |
+-------+-------+ +-----------+----------+
| Pop() | Pop()
^ +-V-+ +-V-+
| Events | Q | Msg Stage | | Q | Display Stage
| Go Up | 0 | Logic-Half | | 1 | Logic-Half
-+------------- | | -------------+------------ | | ---------------
| Requests | | I/O-Half | | | I/O-Half
| Move Down +-^-+ | +-^-+
V | Push() |
+--------------+-------------+ |
| Push OnRecv Event, | +-------+-------+
| 1 Event per message | | | Push()
| | +------+------+ +------+------+
| Epoll I/O thread for | |Push OnTimer | |Push OnTimer |
|multi-messaging connections | | Event/UI-1 | | Event/UI-2 |
+------^-------^--------^----+ +------+------+ +------+------+
| | | | |
Incoming msg1 msg2 msg3 Msg Viewer-1 Msg Viewer-2
:
1 , , ; , .
2 -, - Epoll, C/++ GNU Linux 2.6x; - , , , . 2 - 2 . , Win/MSVC, " " Epoll.
3 2 -, . a) Push-OnRecv ( "CMsg * pMsg = CreateMsg (msg)", C/++); b) UI , , . ( "queue.push(pMsg)" "RingBuff.push(pMsg)", C/++), , ( "pMsg- > Destroy()", C/++). MsgStage() Msg , .
4 OnTimer , Head/Tail ring buff. . Hope UI msg, , . . 3 . , OnScroll. , , OnScroll . , . . , , , OnAgedOut, .
5 , OnTimer OnRecv - , OnTimer() {} OnRecv() {} DisplayStage() MsgStage(). , , , .
6 Q0 2 , ; /. Q1 - . , , . Q2, , DisplayStage() Q1 Q2 . Q0 Q1 - , .
7 MsgStage() DisplayStage() StagedModel.Stage() , Main Thread. Epoll I/O Messaging - , MsgIO, -, Display Thread. 4 , . Effo , MsgIO .
, . EffoNetMsg.pdf http://code.google.com/p/effonetmsg/downloads/list EffoAddons.pdf http://code.google.com/p/effoaddon/downloads/list, ; . EffoDesign_LockFree.pdf http://code.google.com/p/effocore/downloads/list, , .