GRPC C++  1.39.1
Functions
fork_windows.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/port.h"
#include <grpc/fork.h>
#include <grpc/support/log.h>

Functions

void grpc_prefork ()
 gRPC applications should call this before calling fork(). More...
 
void grpc_postfork_parent ()
 
void grpc_postfork_child ()
 
void grpc_fork_handlers_auto_register ()
 

Function Documentation

◆ grpc_fork_handlers_auto_register()

void grpc_fork_handlers_auto_register ( void  )

◆ grpc_postfork_child()

void grpc_postfork_child ( void  )

◆ grpc_postfork_parent()

void grpc_postfork_parent ( void  )

◆ grpc_prefork()

void grpc_prefork ( void  )

gRPC applications should call this before calling fork().

There should be no active gRPC function calls between calling grpc_prefork() and grpc_postfork_parent()/grpc_postfork_child().

Typical use: grpc_prefork(); int pid = fork(); if (pid) { grpc_postfork_parent(); // Parent process.. } else { grpc_postfork_child(); // Child process... }