Commit e136267
committed
gh-134634: Use a pipe instead of a queue for Pool's change notifier
Pool.__init__ used a multiprocessing.SimpleQueue for its internal
_change_notifier. SimpleQueue creates Lock objects backed by POSIX
named semaphores (sem_open), which requires /dev/shm. The change
notifier never crosses a process boundary, so named semaphores were
never needed.
Replace it with a _ChangeNotifier class backed by
multiprocessing.connection.Pipe (os.pipe). Same interface, no
sem_open dependency.
<claude>1 parent cb76ab3 commit e136267
3 files changed
Lines changed: 95 additions & 4 deletions
File tree
- Lib
- multiprocessing
- test
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
150 | 174 | | |
151 | 175 | | |
152 | 176 | | |
| |||
190 | 214 | | |
191 | 215 | | |
192 | 216 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 217 | + | |
197 | 218 | | |
198 | 219 | | |
199 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2828 | 2828 | | |
2829 | 2829 | | |
2830 | 2830 | | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
2831 | 2834 | | |
2832 | 2835 | | |
2833 | 2836 | | |
| |||
3068 | 3071 | | |
3069 | 3072 | | |
3070 | 3073 | | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
3071 | 3109 | | |
3072 | 3110 | | |
3073 | 3111 | | |
| |||
3331 | 3369 | | |
3332 | 3370 | | |
3333 | 3371 | | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
3334 | 3399 | | |
3335 | 3400 | | |
3336 | 3401 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments