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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: GNAT and Tasklets Date: Fri, 19 Dec 2014 09:59:56 +0100 Organization: cbb software GmbH Message-ID: References: <455d0987-734a-4505-bb39-37bfd1a2cc6b@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: YGNMlxhiQ90vAyH0QA4qPw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:24135 Date: 2014-12-19T09:59:56+01:00 List-Id: On Thu, 18 Dec 2014 17:01:18 -0600, Randy Brukardt wrote: > As I noted later, there should only be one task reading/writing the socket > at a time. That might be OK for a server application, but clients must read and write from socket concurrently. In a half-duplex scenario (client-server is) it is highly advisable that one of the peers read and write simultaneously in order to prevent deadlock. Consider a case when a peer tries to write when another is reading. This may happen in half-duplex exchange on protocol errors. For full-duplex exchanges you simply must do it concurrently. There are lots of full-duplex protocols over sockets. > That's of course especially true with a proper higher-level communications > library, since there almost certainly will be instance data that needs to be > protected against multi-access. That is not a problem, usually. The states manipulated when reading and ones upon writing are usually well insulated. >> Having several I/O-processes makes it easy to change the >> way of communication, and still have the same business logic. >> (say an installation from 1992 talks Siemens 3964r/k512 over a serial >> line (its a old standard protocol) and they want to switch plc's >> which talks tcp/ip with another transmission protocol. >> If keeping the messages within the protocol intact, >> then it's just matter of a new I/O process. >> The rest of the system is untouched including business logic processes. >> (I just did this this spring) > > I still think this sounds way too low-level. Typical socket architecture is 1. Low-level I(O 2. Protocol stack(s) 3. Application logic Any of 1-3 can be handled tasks taken from some workers pool. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de