Вверх ↑
Ответов: 655
Рейтинг: 18
#1: 2017-02-26 18:12:17 ЛС | профиль | цитата
Добрый день.

Как правильно организовать потоки чтения и записи SharedMemory для 2х приложений?
Правильно ли использовать такой вариант?

Add(MainForm,11514487,35,112)
{
Width=496
Height=499
link(onCreate,10085504:start,[])
}
Add(Memo,8129461,308,126)
{
Left=230
Top=20
Width=220
Height=410
ScrollBars=2
}
Add(Button,2057548,35,154)
{
Left=10
Top=45
link(onClick,12121531:doNext,[])
}
Add(MultiElementEx,10085504,238,126)
{
link(data,8129461:doAdd,[])
}
BEGIN_SDK
Add(EditMultiEx,16326354,21,21)
{
WorkCount=#5:start|4:send|
EventCount=#4:data|
Width=860
Height=312
link(start,13656572:doEvent1,[])
link(send,10377767:doEvent1,[(73,34)(73,188)])
}
Add(SharedStream,4363001,672,21)
{
CoreName="ttt"
PageMem=4
}
Add(DataToFile,11739912,672,175)
{
Type=5
Point(doPosition)
Point(Position)
link(onGet,16326354:data,[(835,181)(835,27)])
link(Stream,4363001:Stream,[])
}
Add(Hub,13656572,84,21)
{
OutCount=3
link(onEvent1,4363001:doOpen,[])
link(onEvent2,5590172:doCreate,[])
link(onEvent3,11026675:doWork1,[(139,41)])
}
Add(Events,5590172,272,28)
{
Name="evt"
ManualReset=1
}
Add(WaitObject,7750916,272,74)
{
link(ObjHandle,5590172:ObjHandle,[])
}
Add(LineBreak,7191655,177,35)
{
Caption="set"
link(Out,5590172:doSet,[])
Primary=[9987842,198,168]
}
Add(LineBreak,5328045,588,175)
{
Caption="wr"
link(Out,11739912:doPut,[])
Primary=[9886294,-175,21]
}
Add(LineBreak,10244397,626,182)
{
Caption="re"
link(Out,11739912:doGet,[])
Primary=[10941797,-273,-59]
}
Add(Hub,12477375,245,189)
{
OutCount=5
link(onEvent1,14927464:doWork2,[])
link(onEvent2,9886294:In,[])
link(onEvent3,9987842:In,[])
link(onEvent4,11108952:In,[])
link(onEvent5,16442165:In,[])
}
Add(SafeMode,16210678,183,189)
{
Name="123"
Mode=0
link(onSafeMode,12477375:doEvent1,[])
}
Add(LineBreak,13629282,214,42)
{
Caption="reset"
link(Out,5590172:doReset,[])
Primary=[11108952,108,168]
}
Add(HubEx,14927464,462,189)
{
link(onEvent,12573079:doData,[])
}
Add(SafeMode,12832853,273,116)
{
Name="123"
Mode=0
link(onSafeMode,4563249:doEvent1,[])
}
Add(LineBreak,3790066,91,74)
{
Caption="start"
link(Out,11026675:doWork2,[])
Primary=[16442165,196,143]
}
Add(Hub,4563249,328,116)
{
link(onEvent1,14927464:doWork1,[(466,122)])
link(onEvent2,10941797:In,[])
}
Add(DoData,12573079,483,189)
{
Data=Integer(0)
link(onEventData,11739912:doPosition,[])
}
Add(Thread,11430267,180,74)
{
link(onExec,7750916:doWait,[])
link(onSyncExec,12832853:doSafeMode,[(242,87)(242,122)])
}
Add(Hub,10377767,112,182)
{
link(onEvent1,11430267:doStop,[(139,188)(139,87)])
link(onEvent2,16210678:doSafeMode,[])
}
Add(HubEx,11026675,135,74)
{
link(onEvent,11430267:doStart,[])
}
END_SDK
Add(CounterEx,12121531,105,154)
{
link(onNext,10085504:send,[(187,160)(187,139)])
}

карма: 0

0
Редактировалось 1 раз(а), последний 2017-02-26 18:12:45