-
Notifications
You must be signed in to change notification settings - Fork 0
/
parallelism.txt
51 lines (27 loc) · 1.11 KB
/
parallelism.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ok, the ideal is that nftw works, and is parallel.
however neither is the case.
furthermore it would seem that nftw is not even safe to update a global
options
- write dftw
- use nftw and hope for the best
well I imagine that, as life is a combination of pragmatic and idealistic it will have to be both.
it seems that nftw can write to globals, though maybe should replace with other ways (what ways)
so we use nftw just to log filenames, which are then sent to a dispatcher
nftw - ok for file manip - but does return spuriuos(?) files
- do not touch the internal structures
- do not malloc
so
use (n)ftw for walk
- count files and dirs,
return
- malloc arrays
use (n)ftw for walk
- write their names
return
then use a file or shared memory based dispatcher to
do the tasks
+fork according to mem and CPUs available
- dispatcher watches forks, and gives orders (according to load?)
- forks do what they are told, return when everything is done.
- wow, if the program finished, a buggy fork may still be running. exit (from main) does not clean up children!
- so if your system becomes very slow.......