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.15.82 with SMTP id x79mr2186322ioi.17.1470278563955; Wed, 03 Aug 2016 19:42:43 -0700 (PDT) X-Received: by 10.157.47.97 with SMTP id h88mr1275412otb.10.1470278563928; Wed, 03 Aug 2016 19:42:43 -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!f6no7175264ith.0!news-out.google.com!d68ni16159ith.0!nntp.google.com!f6no7175262ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 3 Aug 2016 19:42:43 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=109.252.108.54; posting-account=YB4WOgoAAABLG9D7qoJiPBc6EJSzsPDF NNTP-Posting-Host: 109.252.108.54 References: <5f464ccd-c532-4b4d-8f45-9f29ba41a326@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <349f7cde-2e69-4c4f-8928-ec62cfdaca6c@googlegroups.com> Subject: Re: Win32. Task or CreateThread From: George J Injection-Date: Thu, 04 Aug 2016 02:42:43 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:31280 Date: 2016-08-03T19:42:43-07:00 List-Id: =D1=81=D1=80=D0=B5=D0=B4=D0=B0, 3 =D0=B0=D0=B2=D0=B3=D1=83=D1=81=D1=82=D0= =B0 2016 =D0=B3., 22:43:25 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-03 19:31, George J wrote: >=20 > > Dmitry, I've made some examples,works great!Thanks!And I have one > > question to understand. Function Gtk.Main.Routers.Init has Delay > > parameter 0.2 by default. >=20 > Yes, that parameter controls the timer set in the GTK main. It rarely=20 > need to be faster because except for running curves (e.g. in an=20 > oscilloscope) human eye cannot catch higher frequencies anyway. >=20 > > So, to make my parsing function faster I have > > to decrease this value to 0.001 or 0.00001, am I right? >=20 > No. 1ms (0.001) is the hard limit for thread switching under Windows=20 > anyway, while 10ms is the default. Even a real-time OS would choke at=20 > 10us timer interrupts. >=20 > > Or is there any > > function or solution for more "automatical minimal time delay" without > > my intervention? >=20 > Usually you accumulate changes and report them at the fixed rate=20 > comfortable for the user. E.g. if you have a tight loop: >=20 > declare > Last_Time : Time :=3D Clock; > This_Time : Time; > begin > loop > calculate things ... >=20 > This_Time :=3D Clock; > if This_Time - Last_Time > 0.2 then > report state change to the GUI ... > Last_Time :=3D This_Time; > end if; > end loop; >=20 > You might further filter out small changes, e.g. if, say, the progress=20 > bar change is under 1%, you ignore it. >=20 > Another technique is to run GUI with its own refresh rate and exchange=20 > data through shared object (e.g. protected object or protected by a=20 > mutex object). >=20 > --=20 > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de Ok,Dmitry,thanks a lot!