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: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Safety of unprotected concurrent operations on constant objects Date: Sun, 4 May 2014 10:06:05 +0200 Organization: cbb software GmbH Message-ID: References: <7403d130-8b42-43cd-a0f1-53ba34b46141@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: AuYlnUSfTZrfhAkRjyySpQ.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 X-Original-Bytes: 2331 Xref: number.nntp.dca.giganews.com comp.lang.ada:186204 Date: 2014-05-04T10:06:05+02:00 List-Id: On Sun, 4 May 2014 07:46:00 +0000 (UTC), Natasha Kerensikova wrote: > Now I admit I haven't actually encountered any problem yet, since I'm > the only user of the (very early alpha) web application, with at least > seconds between each request, anything non-task-safe would work. But > going with "it works for now, let's worry about this later" isn't really > in Ada spirit, is it? If you are doing a Web application, then nanoseconds spent on proper locking should be your least worry. [Of course, you don't not do container search on the context of a protected action, i.e. it should be a kind of mutex.] Certainly there are serious problems with designing containers such that they were extensible and supported tasking. I would say it is impossible in Ada right now. But for a Web application all this does not really matter. You should concentrate your efforts on efficient requests routing to worker tasks, ensuring that workers are well-decoupled and don't block each other externally (via a database or file access, for example) etc. Using a mutex somewhere in one of hundreds of worker tasks servicing HTTP requests simply cannot have any effect on either latencies or throughout. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de