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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,36a29c2860aff686 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!y31g2000vbt.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Properties Date: Thu, 2 Dec 2010 13:11:58 -0800 (PST) Organization: http://groups.google.com Message-ID: <2a3219cb-5793-4e5b-97aa-036da124ccba@y31g2000vbt.googlegroups.com> References: <3b84c8e7-1a51-4a7c-9646-119f1fc51478@s4g2000yql.googlegroups.com> <4pnv7nl4cdui$.1n28i7lqk4mek$.dlg@40tude.net> <1k7367gtebsgm$.18auo6u3nfg34.dlg@40tude.net> <1u5dftkqqi68c.10079qnqyyfwb$.dlg@40tude.net> <15tv4yga36dpi$.1hc09dlbgcmqe.dlg@40tude.net> <18768dde-5817-40b9-aaa1-03c620ad7187@i32g2000pri.googlegroups.com> <1sp30ekj4pmer$.1753nbz1zyzid$.dlg@40tude.net> NNTP-Posting-Host: 85.1.108.172 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1291324318 32350 127.0.0.1 (2 Dec 2010 21:11:58 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 2 Dec 2010 21:11:58 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y31g2000vbt.googlegroups.com; posting-host=85.1.108.172; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:15755 Date: 2010-12-02T13:11:58-08:00 List-Id: On Dec 2, 4:46=A0pm, "Dmitry A. Kazakov" wrote: > > Safe? What is the benefit of safe if at the same time it's pointless? > > > Put ("My "); > > Put ("name "); > > Put ("is "); > > Put_Line ("Maciej"); > > > I have multiple tasks doing it. What is safe for you? > > 1. It does not crash, the effect is defined > 2. Put is atomic These are very weak requirements. The information was scrambled - the mail packages arrived at the wrong address, the missile attacked the wrong country and the doctor removed the liver of the wrong patient. But nothing crashed. :-) The reasons why it's pointless to internally synchronize GUI (or Text_IO) are exactly the same as why it's pointless to synchronize standard containers. It's the wrong level of granularity. You might steer away from erroneous execution, but that does not in itself make the program correct. > >> GUI is natively multitasking: > > >> 1. actions invoked by its controls are not instant: progress bar > >> 2. some controls are active objects: animation widgets, visual effects= , > >> tooltips, hovering etc > >> 3. indication of asynchronous events and data: oscilloscope > > > How is that any different from standard output? > > What is different/same from what? GUI from Text_IO. I will try to answer myself: the difference is that Text_IO, as an abstract stream, "feels" sequential by nature, whereas GUI, with its 2D layout (+ time dimension for content changes), makes concurrency more appealing. Still, good design principles call for decoupling of application logic and display (maybe with some intermediate "data model" module?) and this decoupling blurs that distinction significantly. I'm not convinced that GUI should be task-safe. Supporting bad application designs would be a wrong justification. -- Maciej Sobczak * http://www.inspirel.com