forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4bad60e
committed
Allow latches to wait for socket writability without waiting for readability.
So far WaitLatchOrSocket() required to pass in WL_SOCKET_READABLE asthat solely was used to indicate error conditions, like EOF. Waitingfor WL_SOCKET_WRITEABLE would have meant to busy wait upon socketerrors.Adjust the API to signal errors by returning the socket as readable,writable or both, depending on WL_SOCKET_READABLE/WL_SOCKET_WRITEABLEbeing specified. It would arguably be nicer to return WL_SOCKET_ERRORbut that's not possible on platforms and would probably also result inmore complex callsites.This previously had explicitly been forbidden ine42a21b, asthere was no strong use case at that point. We now are looking intomaking FE/BE communication use latches, so changing this makes sense.There also are some portability concerns because there cases of olderplatforms where select(2) is known to, in violation of POSIX, notreturn a socket as writable after the peer has closed it. So far theplatforms where that's the case provide a working poll(2). If we findone where that's not the case, we'll need to add a workaround for thatplatform.Discussion: 20140927191243.GD5423@alap3.anarazel.deReviewed-By: Heikki Linnakangas, Noah Misch1 parent3dfce37 commit4bad60e
2 files changed
+34
-12
lines changedLines changed: 24 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
203 |
| - | |
204 |
| - | |
205 |
| - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
206 | 206 |
| |
207 | 207 |
| |
208 | 208 |
| |
| |||
230 | 230 |
| |
231 | 231 |
| |
232 | 232 |
| |
233 |
| - | |
234 |
| - | |
235 | 233 |
| |
236 | 234 |
| |
237 | 235 |
| |
| |||
291 | 289 |
| |
292 | 290 |
| |
293 | 291 |
| |
294 |
| - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
295 | 302 |
| |
296 | 303 |
| |
297 | 304 |
| |
| |||
346 | 353 |
| |
347 | 354 |
| |
348 | 355 |
| |
349 |
| - | |
| 356 | + | |
350 | 357 |
| |
351 | 358 |
| |
352 | 359 |
| |
353 | 360 |
| |
354 | 361 |
| |
355 | 362 |
| |
356 | 363 |
| |
| 364 | + | |
357 | 365 |
| |
358 | 366 |
| |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
359 | 375 |
| |
360 | 376 |
| |
361 | 377 |
| |
| |||
439 | 455 |
| |
440 | 456 |
| |
441 | 457 |
| |
| 458 | + | |
442 | 459 |
| |
443 | 460 |
| |
444 | 461 |
| |
|
Lines changed: 10 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
117 | 117 |
| |
118 | 118 |
| |
119 | 119 |
| |
120 |
| - | |
121 |
| - | |
122 | 120 |
| |
123 | 121 |
| |
124 | 122 |
| |
| |||
152 | 150 |
| |
153 | 151 |
| |
154 | 152 |
| |
155 |
| - | |
| 153 | + | |
156 | 154 |
| |
157 | 155 |
| |
158 |
| - | |
| 156 | + | |
159 | 157 |
| |
160 | 158 |
| |
161 | 159 |
| |
| |||
232 | 230 |
| |
233 | 231 |
| |
234 | 232 |
| |
235 |
| - | |
| 233 | + | |
236 | 234 |
| |
237 | 235 |
| |
238 | 236 |
| |
| |||
241 | 239 |
| |
242 | 240 |
| |
243 | 241 |
| |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
244 | 249 |
| |
245 | 250 |
| |
246 | 251 |
| |
|
0 commit comments
Comments
(0)