[PATCH v7 00/12] Simple IPC Mechanism
flat view
STALE2041d
From: Jeff Hostetler via GitGitGadget <hidden>
Date: 2021-03-22 10:30:30
Revision v7 of 6 in this series.
Revisions (6)
Here is version V7 of my simple-ipc series. The only change from V6 is to
squash in the CALLOC_ARRAY() suggestion.
$ git range-diff v2.31.0-rc1..pr-766/jeffhostetler/simple-ipc-v6
v2.31.0-rc1..HEAD 1: fe35dc3d29 = 1: fe35dc3d29 pkt-line: eliminate the need
for static buffer in packet_write_gently() 2: de11b30361 = 2: de11b30361
pkt-line: do not issue flush packets in write_packetized_*() 3: 3718da39da =
3: 3718da39da pkt-line: add PACKET_READ_GENTLE_ON_READ_ERROR option 4:
b43df7ad0b = 4: b43df7ad0b pkt-line: add options argument to
read_packetized_to_strbuf() 5: f829feb2aa = 5: f829feb2aa simple-ipc: design
documentation for new IPC mechanism 6: 58c3fb7cd7 = 6: 58c3fb7cd7
simple-ipc: add win32 implementation 7: 4e8c352fb3 = 7: 4e8c352fb3
unix-socket: eliminate static unix_stream_socket() helper function 8:
3b71f52d86 = 8: 3b71f52d86 unix-socket: add backlog size option to
unix_stream_listen() 9: 5972a19836 = 9: 5972a19836 unix-socket: disallow
chdir() when creating unix domain sockets 10: 02c885fd62 = 10: 02c885fd62
unix-stream-server: create unix domain socket under lock 11: 4c2199231d !
11: eee5f4796d simple-ipc: add Unix domain socket implementation @@
compat/simple-ipc/ipc-unix-socket.c (new) +
pthread_cond_init(&server_data->work_available_cond, NULL); + +
server_data->queue_size = nr_threads * FIFO_SCALE; -+ server_data->fifo_fds
= xcalloc(server_data->queue_size, -+ sizeof(*server_data->fifo_fds)); ++
CALLOC_ARRAY(server_data->fifo_fds, server_data->queue_size); + +
server_data->accept_thread = + xcalloc(1,
sizeof(*server_data->accept_thread)); 12: 132b6f3271 = 12: 8b5dcca684 t0052:
add simple-ipc tests and t/helper/test-simple-ipc tool
Jeff
Jeff Hostetler (9):
pkt-line: eliminate the need for static buffer in
packet_write_gently()
simple-ipc: design documentation for new IPC mechanism
simple-ipc: add win32 implementation
unix-socket: eliminate static unix_stream_socket() helper function
unix-socket: add backlog size option to unix_stream_listen()
unix-socket: disallow chdir() when creating unix domain sockets
unix-stream-server: create unix domain socket under lock
simple-ipc: add Unix domain socket implementation
t0052: add simple-ipc tests and t/helper/test-simple-ipc tool
Johannes Schindelin (3):
pkt-line: do not issue flush packets in write_packetized_*()
pkt-line: add PACKET_READ_GENTLE_ON_READ_ERROR option
pkt-line: add options argument to read_packetized_to_strbuf()
Documentation/technical/api-simple-ipc.txt | 105 +++
Makefile | 9 +
builtin/credential-cache--daemon.c | 3 +-
builtin/credential-cache.c | 2 +-
compat/simple-ipc/ipc-shared.c | 28 +
compat/simple-ipc/ipc-unix-socket.c | 999 +++++++++++++++++++++
compat/simple-ipc/ipc-win32.c | 751 ++++++++++++++++
config.mak.uname | 2 +
contrib/buildsystems/CMakeLists.txt | 8 +-
convert.c | 11 +-
pkt-line.c | 59 +-
pkt-line.h | 17 +-
simple-ipc.h | 239 +++++
t/helper/test-simple-ipc.c | 787 ++++++++++++++++
t/helper/test-tool.c | 1 +
t/helper/test-tool.h | 1 +
t/t0052-simple-ipc.sh | 122 +++
unix-socket.c | 53 +-
unix-socket.h | 12 +-
unix-stream-server.c | 125 +++
unix-stream-server.h | 33 +
21 files changed, 3315 insertions(+), 52 deletions(-)
create mode 100644 Documentation/technical/api-simple-ipc.txt
create mode 100644 compat/simple-ipc/ipc-shared.c
create mode 100644 compat/simple-ipc/ipc-unix-socket.c
create mode 100644 compat/simple-ipc/ipc-win32.c
create mode 100644 simple-ipc.h
create mode 100644 t/helper/test-simple-ipc.c
create mode 100755 t/t0052-simple-ipc.sh
create mode 100644 unix-stream-server.c
create mode 100644 unix-stream-server.h
base-commit: f01623b2c9d14207e497b21ebc6b3ec4afaf4b46
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-766%2Fjeffhostetler%2Fsimple-ipc-v7
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-766/jeffhostetler/simple-ipc-v7
Pull-Request: https://github.com/gitgitgadget/git/pull/766
Range-diff vs v6:
1: fe35dc3d292d = 1: fe35dc3d292d pkt-line: eliminate the need for static buffer in packet_write_gently()
2: de11b3036148 = 2: de11b3036148 pkt-line: do not issue flush packets in write_packetized_*()
3: 3718da39da30 = 3: 3718da39da30 pkt-line: add PACKET_READ_GENTLE_ON_READ_ERROR option
4: b43df7ad0b7a = 4: b43df7ad0b7a pkt-line: add options argument to read_packetized_to_strbuf()
5: f829feb2aa93 = 5: f829feb2aa93 simple-ipc: design documentation for new IPC mechanism
6: 58c3fb7cd776 = 6: 58c3fb7cd776 simple-ipc: add win32 implementation
7: 4e8c352fb366 = 7: 4e8c352fb366 unix-socket: eliminate static unix_stream_socket() helper function
8: 3b71f52d8628 = 8: 3b71f52d8628 unix-socket: add backlog size option to unix_stream_listen()
9: 5972a198361c = 9: 5972a198361c unix-socket: disallow chdir() when creating unix domain sockets
10: 02c885fd623d = 10: 02c885fd623d unix-stream-server: create unix domain socket under lock
11: 4c2199231d05 ! 11: eee5f4796d37 simple-ipc: add Unix domain socket implementation
@@ compat/simple-ipc/ipc-unix-socket.c (new)
+ pthread_cond_init(&server_data->work_available_cond, NULL);
+
+ server_data->queue_size = nr_threads * FIFO_SCALE;
-+ server_data->fifo_fds = xcalloc(server_data->queue_size,
-+ sizeof(*server_data->fifo_fds));
++ CALLOC_ARRAY(server_data->fifo_fds, server_data->queue_size);
+
+ server_data->accept_thread =
+ xcalloc(1, sizeof(*server_data->accept_thread));
12: 132b6f3271be = 12: 8b5dcca68440 t0052: add simple-ipc tests and t/helper/test-simple-ipc tool
--
gitgitgadget