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!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder1.news.weretis.net!news.swapon.de!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Safety of unprotected concurrent operations on constant objects (was: Safety of unprotected concurrent operations on constant objects) Date: Wed, 7 May 2014 14:36:47 +0200 Organization: cbb software GmbH Message-ID: References: <6c2cd5d4-a44c-4c18-81a3-a0e87d25cd9e@googlegroups.com> <83ha6vuynrzs.1jk08faxb8mnl.dlg@40tude.net> <97a0996a-a593-4990-95e9-44f4e9070fd3@googlegroups.com> <5368b00d$0$6703$9b4e6d93@newsspool3.arcor-online.net> <5368dc70$0$6708$9b4e6d93@newsspool3.arcor-online.net> <1fe3nmaxcrah3.1t38gw7e4zfz3$.dlg@40tude.net> <60hajlhql29h$.1jh2ixlq35vtm.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: G+aXx1XI67D34t54ibhUPQ.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:19733 Date: 2014-05-07T14:36:47+02:00 List-Id: On Wed, 07 May 2014 13:29:24 +0200, J-P. Rosen wrote: > Which SQLite is not, unfortunately, and despite what they seem to tell. It is difficult to do with single file, I suppose. If the DB is single-file and transactions are safe, in the sense that if you turn the power off when a transaction is pending (the file is being written), the effect is like rolling all updates back. Then multiple transactions is a hardball. I toyed with an idea of making a safe equivalent of Ada's Direct_IO. Even with single transaction it would be very challenging. My idea, roughly, was to map file blocks: virtual -> physical. When a virtual block gets updated a new physical is allocated or reused and the mapping is adjusted. When the transaction is committed the mapping is stored in the file check-summed etc. Old blocks are reused upon next transaction. This would be a single-transaction schema. > In our case, we have less than 1% chance of having two transactions at > the same time, so the bottleneck is not an issue (as long as we don't > ruin the database, which IS important). Other contexts may be different, > of course. I think a better case for synchronization monitor would be GUI (when based on a messages loop). Windows GDI is task-safe because it sends messages to the loop. This is a monitor already. I don't understand why GTK (under Linux) tried to use locks instead of marshaling messages. It does not make sense to me. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de