1/*-------------------------------------------------------------------------
5 * Parallel support for pg_dump and pg_restore
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/bin/pg_dump/parallel.h
13 *-------------------------------------------------------------------------
16#ifndef PG_DUMP_PARALLEL_H
17#define PG_DUMP_PARALLEL_H
23/* Function to call in leader process on completion of a worker task */
29/* Wait options for WaitForWorkers */
39 * Maximum number of parallel jobs allowed.
41 * On Windows we can only have at most MAXIMUM_WAIT_OBJECTS (= 64 usually)
42 * parallel jobs because that's the maximum limit for the
43 * WaitForMultipleObjects() call.
46#define PG_MAX_JOBS MAXIMUM_WAIT_OBJECTS
48 #define PG_MAX_JOBS INT_MAX
51/* ParallelSlot is an opaque struct known only within parallel.c */
54/* Overall state for parallel.c */
58 /* these arrays have numWorkers entries, one per worker: */
64extern bool parallel_init_done;
65extern DWORD mainThreadId;
85#endif /* PG_DUMP_PARALLEL_H */
void ParallelBackupEnd(ArchiveHandle *AH, ParallelState *pstate)
void WaitForWorkers(ArchiveHandle *AH, ParallelState *pstate, WFW_WaitOption mode)
ParallelState * ParallelBackupStart(ArchiveHandle *AH)
void(* ParallelCompletionPtr)(ArchiveHandle *AH, TocEntry *te, int status, void *callback_data)
void DispatchJobForTocEntry(ArchiveHandle *AH, ParallelState *pstate, TocEntry *te, T_Action act, ParallelCompletionPtr callback, void *callback_data)
void init_parallel_dump_utils(void)
bool IsEveryWorkerIdle(ParallelState *pstate)
struct ParallelState ParallelState
void set_archive_cancel_info(ArchiveHandle *AH, PGconn *conn)
static PgChecksumMode mode
ParallelSlot * parallelSlot
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)