1

Topic: File recording from several processes with the right to removal

All greetings. At the moment some independent processes can write the data to the same file. They open , open a file, write down the data, close a file, release . It becomes a bottleneck and demands optimization. A bicycle: service (in the beginning In Memory, then separate process), with queue for each file. The separate flow on each file which assorts the data and writes packs to a file. A question No1: probably, it can be organized without a bicycle? Standard means WinAPI? A question No2: whether it is possible to get rid from , automatically delivering in queue of all wishing to open a file on record?

2

Re: File recording from several processes with the right to removal

Hello, LWhisper, you wrote: LW> All greetings. LW> at the moment some independent processes can write the data to the same file. LW> they open , open a file, write down the data, close a file, release . LW> It becomes a bottleneck and demands optimization. It is possible to begin with holding a file the opened. Probably it it appears enough. LW> the Bicycle: service (in the beginning In Memory, then separate process), with queue for each file. The separate flow on each file which assorts the data and writes packs to a file. LW> a question No1: probably, it can be organized without a bicycle? Standard means WinAPI? LW> the Question No2: whether it is possible to get rid from , automatically delivering in queue of all wishing to open a file on record? Processes write to the same place in a file or in the different? If in different, it is possible to lock not a file entirely, and specific places (LockFileEx), and thus to increase competition. The second important question, whether the warranty of successful record for operation continuation is necessary to process? If yes, all these dances with separate service help a little.

3

Re: File recording from several processes with the right to removal

LW> the Question No1: probably, it can be organized without a bicycle? Standard means WinAPI? LW> the Question No2: whether it is possible to get rid from , automatically delivering in queue of all wishing to open a file on record? Atomic adding of a line from set of processes - was offered very interesting decision, but with usage  API from ntdll

4

Re: File recording from several processes with the right to removal

Hello, LWhisper, you wrote: LW> All greetings. LW> at the moment some independent processes can write the data to the same file. LW> they open , open a file, write down the data, close a file, release . LW> It becomes a bottleneck and demands optimization. LW> a bicycle: service (in the beginning In Memory, then separate process), with queue for each file. The separate flow on each file which assorts the data and writes packs to a file. LW> a question No1: probably, it can be organized without a bicycle? Standard means WinAPI? LW> the Question No2: whether it is possible to get rid from , automatically delivering in queue of all wishing to open a file on record? I about such piece did by means of queue (queues) of messages. It was the problem with a condition of usage either divided storage, or message queue. I created . There was one message queue where new processes sent messages on adding/removal of and at adding sent id.  each added process there was a message queue with a name [_] id. And already in these queues messages dataful registered. Queues were processed by the manager and as look terrible this all can, in the end it turned out conveniently enough for usage. In the approach justification it is possible to tell that it is pattern Manager/Worker or like that And message queues to use  it is a pleasure. : do not kick strongly

5

Re: File recording from several processes with the right to removal

W> It is possible to begin with holding a file the opened. Probably it it appears enough. It is impossible so "with the right to removal". If a file to hold opened, it will be marked on removal and all records after this disappear. Removal should happen quickly, on a place of an old file - to form the new. W> processes write to the same place in a file or in the different? If in different, it is possible to lock not a file entirely, and specific places (LockFileEx), and thus to increase competition. In the file end. W> the second important question, whether the warranty of successful record for operation continuation is necessary to process? If yes, all these dances with separate service help a little. It is not necessary.

6

Re: File recording from several processes with the right to removal

Hello, plastictown, you wrote: P> I about such piece did by means of queue (queues) of messages. It was the problem with a condition of usage either divided storage, or message queue. I created . There was one message queue where new processes sent messages on adding/removal of and at adding sent id.  each added process there was a message queue with a name [_] id. And already in these queues messages dataful registered. Queues were processed by the manager and as look terrible this all can, in the end it turned out conveniently enough for usage. In the approach justification it is possible to tell that it is pattern Manager/Worker or like that And message queues to use  it is a pleasure. Yes, to such bicycle all also goes.

7

Re: File recording from several processes with the right to removal

Hello, EreTIk, you wrote: ETI> atomic adding of a line from set of processes - was offered very interesting decision, but with usage  API from ntdll Aha, I thank, with a question , it is possible to tell, understood.

8

Re: File recording from several processes with the right to removal

Hello, LWhisper, you wrote: Ah, so it is broad gulls. In normal applications each process writes broad gulls to the file.  broad gulls-files between processes it is fraught with much more serious problems, than poor performance. And for control and convenient review of dens there is a set of tools.

9

Re: File recording from several processes with the right to removal

Hello, wildwind, you wrote: W> Ah so it is broad gulls. In normal applications each process writes broad gulls to the file.  broad gulls-files between processes it is fraught with much more serious problems, than poor performance. And for control and convenient review of dens there is a set of tools. But we live in the real world.

10

Re: File recording from several processes with the right to removal

Hello, LWhisper, you wrote: W>> Ah so it is broad gulls. In normal applications each process writes broad gulls to the file.  broad gulls-files between processes it is fraught with much more serious problems, than poor performance. And for control and convenient review of dens there is a set of tools. LW> but we live in the real world. Write then to any buffer-in-memory (sink), in a streaming mode. And the buffer will write to a file.