Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #196390
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Best (simplest) way to share data (Posting On Python-List Prohibited) |
| Date | 2024-07-07 01:43 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <v6crrk$1kfb$6@dont-email.me> (permalink) |
| References | <9a8nlk-jb81.ln1@q957.zbmc.eu> |
On Sat, 6 Jul 2024 08:28:41 +0100, Chris Green wrote: > One fairly obvious way is to have single process/script which reads the > A2D values continuously and writes them to a file. All other scripts > then read from the file as needed, a simple file lock can then be used > to prevent simultaneous access (well, simultaneous access when the > writing process is writing). The thing with a file is, it persists even when the collector process is not running. Do you want data that persists when the collector process is not running? Is this a history of values, or just a snapshot of current values? A history of values could be written to a database. Databases provide their own transactions and interlocking to prevent readers from reading partial updates. If it’s a snapshot of current values, that does not persist when the collector process is not running, then why not just keep the data in the memory of the collector process, and have it concurrently listen on a socket for connections from readers requesting a copy of the current data?
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Best (simplest) way to share data between processes Chris Green <cl@isbd.net> - 2024-07-06 08:28 +0100
Re: Best (simplest) way to share data between processes Gordinator <gordinator@gordinator.org> - 2024-07-06 20:03 +0100
Re: Best (simplest) way to share data between processes Piergiorgio Sartor <piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de> - 2024-07-06 21:32 +0200
Re: Best (simplest) way to share data between processes Chris Green <cl@isbd.net> - 2024-07-08 13:52 +0100
Re: Best (simplest) way to share data (Posting On Python-List Prohibited) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-07-07 01:43 +0000
Re: Best (simplest) way to share data (Posting On Python-List Prohibited) Chris Green <cl@isbd.net> - 2024-07-08 13:56 +0100
Re: Best (simplest) way to share data (Posting On Python-List Prohibited) Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-07-09 05:52 +0000
Re: Best (simplest) way to share data Chris Green <cl@isbd.net> - 2024-07-09 11:02 +0100
Re: Best (simplest) way to share data between processes Barry <barry@barrys-emacs.org> - 2024-07-07 23:27 +0100
Re: Best (simplest) way to share data between processes MRAB <python@mrabarnett.plus.com> - 2024-07-07 23:47 +0100
Re: Best (simplest) way to share data between processes Barry Scott <barry@barrys-emacs.org> - 2024-07-08 09:34 +0100
Re: Best (simplest) way to share data between processes Left Right <olegsivokon@gmail.com> - 2024-07-07 23:55 +0200
csiph-web