From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.12.146 with SMTP id 18mr2954161iom.0.1470379739363; Thu, 04 Aug 2016 23:48:59 -0700 (PDT) X-Received: by 10.157.10.77 with SMTP id 71mr1098536otg.15.1470379739309; Thu, 04 Aug 2016 23:48:59 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!f6no7488380ith.0!news-out.google.com!d130ni25127ith.0!nntp.google.com!f6no7468355ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 4 Aug 2016 23:48:59 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=95.173.128.204; posting-account=YB4WOgoAAABLG9D7qoJiPBc6EJSzsPDF NNTP-Posting-Host: 95.173.128.204 References: <5f464ccd-c532-4b4d-8f45-9f29ba41a326@googlegroups.com> <1dde5cdf-f1a8-4e5d-8d7d-60c89c554f6a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <95a6be7b-8776-4545-ab00-735b70121dce@googlegroups.com> Subject: Re: Win32. Task or CreateThread From: George J Injection-Date: Fri, 05 Aug 2016 06:48:59 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:31293 Date: 2016-08-04T23:48:59-07:00 List-Id: =D0=BF=D1=8F=D1=82=D0=BD=D0=B8=D1=86=D0=B0, 5 =D0=B0=D0=B2=D0=B3=D1=83=D1= =81=D1=82=D0=B0 2016 =D0=B3., 9:18:05 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7= =D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Dmitry A. Kazakov =D0=BD=D0=B0= =D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > On 2016-08-05 06:25, George J wrote: >=20 > > Hi All! I have a question for Gtk.Main.Routers, that i can't understand= . > > I have next: > > > > type My_Record is > > record > > ....... > > end record > > > > type My_Record_Access is access all My_Record; > > > > Test_Record_Access : My_Record_Access; > > > > package Cb_Request is new Gtk.Main.Router.Generic_Callback_Request(User= _Data =3D> My_Record); > > > > task type My_Task is -- works well > > entry Start; > > end My_Task; > > > > task body My_Task is > > begin > > accept Start; > > > > Cb_Request.Request(Some_Proc'Access,Test_Record_Access); -- all o= k > > > > end My_Task; > > > > But I need to send parameter to discriminant like this > > .. in some proc > > Some_Task.Start(Test_Record_Access) > > > > and decl: > > > > task type My_Task is -- works bad > > entry Start(Rec_Acc:My_Record_Access); > > end My_Task; > > > > task body My_Task is > > begin > > accept Start(Rec_Acc:My_Record_Access) do > > Cb_Request.Request(Some_Proc'Access,Rec_Acc); -- "freezed" > > end Start; > > end My_Task; >=20 > You have a deadlock here. The main task, that runs messages loop,=20 > engages the rendezvous Start with My_Task. During the rendezvous My_Task= =20 > makes a request back which waits for main task timer callback to be=20 > serviced. That never happens because the main task sits in the rendezvous= . >=20 > What you can do is to move the request out of the rendezvous letting the= =20 > caller (main) task go: >=20 > task body My_Task is > Data : My_Record_Access; > begin > accept Start (Rec_Acc : My_Record_Access) do > Data :=3D Rec_Acc; -- Copy the parameter > end Start; -- Let go > Cb_Request.Request (Some_Proc'Access, Data); -- Ask back > end My_Task; >=20 > --=20 > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de Yeah!!It Works! I'll deal with the rendezvous mechanism. Thanks a lot Dmitr= y!