-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add & use ipc_sync.h and ipc_sync.c #517
Conversation
This replaces #514. The API is slightly different: it now includes |
|
||
/* close(), but looping upon EINTR. */ | ||
static inline int | ||
ipc_sync_close(int fd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two notable things about this function:
- we will replace it once we have
noeintr_close()
. - this function retains the previous behaviour of
daemonize.c
, namely that ifclose()
hasEINTR
, this function callsclose()
again. This behaviour is required for HP-UX, but is explicitly wrong for the glibc implementation ofclose()
: https://www.man7.org/linux/man-pages/man2/close.2.html
I propose that we keep the same behaviour as before (which is broken on linux), but I thought that I should bring it to your attention.
|
||
/** | ||
* ipc_sync_wait_prep(IS): | ||
* Perform any operation(s) that would speed up an upcoming call to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat vaguely-worded because a different implementation of synchronization might have no "pre-wait" operations. For example, if we used a sem_t
on some platforms (since it's not portable everywhere), the _prep()
functions would be a no-op.
2038282
to
900f8b5
Compare
util/daemonize.c
Outdated
* explicitly closing it for the benefit of leak checkers. | ||
* Free resources associated with ${IS}. These would be | ||
* released by the following _exit(), but we're explicitly | ||
* closing it for the benefit of leak checkers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/closing it/releasing them/
util/ipc_sync.h
Outdated
* 4) both processes: ipc_sync_done() | ||
* | ||
* If there's a need to make _wait() or _signal() as fast as possible | ||
* (i.e. for a benchmark or a performance bottleneck), call the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/i.e./e.g./
Ok aside from very minor comment nits. Please fix and then I'll merge. |
03129db
to
0a85a39
Compare
No description provided.