|
12 | 12 | #include "access/attnum.h" |
13 | 13 | #include "utils/relcache.h" |
14 | 14 |
|
| 15 | + |
15 | 16 | /* Defines */ |
16 | 17 | #define KVKEYJUNK "__key_junk" |
17 | 18 |
|
|
23 | 24 |
|
24 | 25 | #define PATHMAXLENGTH 4096 |
25 | 26 |
|
26 | | -#define BUFSIZE 65536 |
| 27 | +#define BUFSIZE 65536 * sizeof(char) |
27 | 28 |
|
28 | 29 | #define FILENAMELENGTH 20 |
29 | 30 |
|
30 | 31 | #define RESPONSEFILE "/KVSharedResponse" |
31 | 32 |
|
32 | 33 | #define RESPONSEQUEUELENGTH 2 |
33 | 34 |
|
34 | | -#define DATAAREASIZE sizeof(char)*BUFSIZE |
35 | | - |
36 | 35 |
|
37 | 36 | /* Shared memory for function requests: |
38 | | - * mutex is used for the mutual exclusion of the request buffer; |
39 | | - * full is used to tell whether the request buffer is full; |
40 | | - * agent[2] are used to synchronize the creation of the worker process; |
41 | | - * worker is used to notify the worker process after a request is submitted; |
42 | | - * responseMutexes[RESPONSEQUEUELENGTH] are used for the mutual exclusion of the response buffer; |
43 | | - * responseSync[RESPONSEQUEUELENGTH] are used to notify child processes after the response is ready. |
| 37 | + * mutex: mutual exclusion of the request buffer; |
| 38 | + * full: tell whether the request buffer is full; |
| 39 | + * agent[2]: synchronize the creation of the worker process; |
| 40 | + * worker: notify the worker process after a request is submitted; |
| 41 | + * responseMutexes[RESPONSEQUEUELENGTH]: |
| 42 | + * mutual exclusion of the response buffer; |
| 43 | + * responseSync[RESPONSEQUEUELENGTH]: |
| 44 | + * notify child processes after the response is ready. |
44 | 45 | */ |
45 | 46 | typedef struct SharedMem { |
46 | 47 | sem_t mutex; |
47 | 48 | sem_t full; |
48 | 49 | sem_t agent[2]; |
49 | 50 | sem_t worker; |
50 | | - sem_t responseMutexes[RESPONSEQUEUELENGTH]; |
| 51 | + sem_t responseMutex[RESPONSEQUEUELENGTH]; |
51 | 52 | sem_t responseSync[RESPONSEQUEUELENGTH]; |
52 | 53 | bool workerProcessCreated; |
53 | 54 | char area[BUFSIZE]; // assume ~64K for a tuple is enough |
|
0 commit comments