Concurrent prototype » History » Version 4
Greg Burri, 08/11/2009 02:01 PM
1 | 1 | Greg Burri | h1. Concurrent prototype |
---|---|---|---|
2 | |||
3 | h2. Goals |
||
4 | |||
5 | * Define a strategy to read and to write the same file from different threads. |
||
6 | 2 | Greg Burri | * Test by creating many thread which will write and read in the same time the same file. |
7 | 1 | Greg Burri | |
8 | h2. Description |
||
9 | |||
10 | When a download starts the corresponding file with the final size is created. The file will be filled from different thread during the downloading. Each thread take a part of the file. |
||
11 | 3 | Greg Burri | |
12 | h2. Solution |
||
13 | |||
14 | 4 | Greg Burri | Two descriptor are opened per file. One for write operations and an another for those of reading. Each descriptor is kept by a mutex. There can't be two read or two write in the same time but there can have a read and a write simultaneous. I think there is no gain to read simultaneous from different threads. |