PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | shm_mq_iovec |
Typedefs | |
typedef struct shm_mq | shm_mq |
typedef struct shm_mq_handle | shm_mq_handle |
Enumerations | |
enum | shm_mq_result { SHM_MQ_SUCCESS , SHM_MQ_WOULD_BLOCK , SHM_MQ_DETACHED } |
Functions | |
shm_mq * | shm_mq_create (void *address, Size size) |
void | shm_mq_set_receiver (shm_mq *mq, PGPROC *) |
void | shm_mq_set_sender (shm_mq *mq, PGPROC *) |
PGPROC * | shm_mq_get_receiver (shm_mq *) |
PGPROC * | shm_mq_get_sender (shm_mq *) |
shm_mq_handle * | shm_mq_attach (shm_mq *mq, dsm_segment *seg, BackgroundWorkerHandle *handle) |
void | shm_mq_set_handle (shm_mq_handle *, BackgroundWorkerHandle *) |
void | shm_mq_detach (shm_mq_handle *mqh) |
shm_mq * | shm_mq_get_queue (shm_mq_handle *mqh) |
shm_mq_result | shm_mq_send (shm_mq_handle *mqh, Size nbytes, const void *data, bool nowait, bool force_flush) |
shm_mq_result | shm_mq_sendv (shm_mq_handle *mqh, shm_mq_iovec *iov, int iovcnt, bool nowait, bool force_flush) |
shm_mq_result | shm_mq_receive (shm_mq_handle *mqh, Size *nbytesp, void **datap, bool nowait) |
shm_mq_result | shm_mq_wait_for_attach (shm_mq_handle *mqh) |
Variables | |
PGDLLIMPORT const Size | shm_mq_minimum_size |
typedef struct shm_mq_handle shm_mq_handle |
enum shm_mq_result |
shm_mq_handle* shm_mq_attach | ( | shm_mq * | mq, |
dsm_segment * | seg, | ||
BackgroundWorkerHandle * | handle | ||
) |
Definition at line 290 of file shm_mq.c.
References Assert, CurrentMemoryContext, shm_mq::mq_receiver, shm_mq::mq_sender, shm_mq_handle::mqh_buffer, shm_mq_handle::mqh_buflen, shm_mq_handle::mqh_consume_pending, shm_mq_handle::mqh_context, shm_mq_handle::mqh_counterparty_attached, shm_mq_handle::mqh_expected_bytes, shm_mq_handle::mqh_handle, shm_mq_handle::mqh_length_word_complete, shm_mq_handle::mqh_partial_bytes, shm_mq_handle::mqh_queue, shm_mq_handle::mqh_segment, shm_mq_handle::mqh_send_pending, MyProc, on_dsm_detach(), palloc(), PointerGetDatum(), and shm_mq_detach_callback().
Referenced by attach_to_queues(), ExecParallelGetReceiver(), ExecParallelSetupTupleQueues(), InitializeParallelDSM(), pa_setup_dsm(), ParallelApplyWorkerMain(), ParallelWorkerMain(), ReinitializeParallelDSM(), and test_shm_mq_setup().
Definition at line 177 of file shm_mq.c.
References Assert, MAXALIGN, MAXALIGN_DOWN, shm_mq::mq_bytes_read, shm_mq::mq_bytes_written, shm_mq::mq_detached, shm_mq::mq_mutex, shm_mq::mq_receiver, shm_mq::mq_ring_offset, shm_mq::mq_ring_size, shm_mq::mq_sender, pg_atomic_init_u64(), size, and SpinLockInit.
Referenced by ExecParallelSetupTupleQueues(), InitializeParallelDSM(), pa_setup_dsm(), ReinitializeParallelDSM(), and setup_dynamic_shared_memory().
void shm_mq_detach | ( | shm_mq_handle * | mqh | ) |
Definition at line 843 of file shm_mq.c.
References cancel_on_dsm_detach(), shm_mq_handle::mqh_buffer, shm_mq_handle::mqh_queue, shm_mq_handle::mqh_segment, shm_mq_handle::mqh_send_pending, pfree(), PointerGetDatum(), shm_mq_detach_callback(), shm_mq_detach_internal(), and shm_mq_inc_bytes_written().
Referenced by DestroyParallelContext(), ExecParallelFinish(), HandleParallelMessage(), LaunchParallelWorkers(), logicalrep_pa_worker_stop(), mq_putmessage(), pa_detach_all_error_mq(), pa_free_worker_info(), tqueueDestroyReceiver(), and tqueueShutdownReceiver().
shm_mq* shm_mq_get_queue | ( | shm_mq_handle * | mqh | ) |
Definition at line 905 of file shm_mq.c.
References shm_mq_handle::mqh_queue.
Referenced by WaitForParallelWorkersToAttach(), and WaitForParallelWorkersToFinish().
Definition at line 242 of file shm_mq.c.
References shm_mq::mq_mutex, shm_mq::mq_receiver, SpinLockAcquire, and SpinLockRelease.
Referenced by shm_mq_send_bytes(), and shm_mq_wait_for_attach().
Definition at line 257 of file shm_mq.c.
References shm_mq::mq_mutex, shm_mq::mq_sender, SpinLockAcquire, and SpinLockRelease.
Referenced by shm_mq_receive(), shm_mq_wait_for_attach(), WaitForParallelWorkersToAttach(), and WaitForParallelWorkersToFinish().
shm_mq_result shm_mq_receive | ( | shm_mq_handle * | mqh, |
Size * | nbytesp, | ||
void ** | datap, | ||
bool | nowait | ||
) |
Definition at line 572 of file shm_mq.c.
References Assert, ereport, errcode(), errmsg(), ERROR, MAXALIGN, MaxAllocSize, MemoryContextAlloc(), Min, shm_mq::mq_detached, shm_mq::mq_receiver, shm_mq::mq_ring_size, shm_mq::mq_sender, shm_mq_handle::mqh_buffer, shm_mq_handle::mqh_buflen, shm_mq_handle::mqh_consume_pending, shm_mq_handle::mqh_context, shm_mq_handle::mqh_counterparty_attached, shm_mq_handle::mqh_expected_bytes, shm_mq_handle::mqh_handle, MQH_INITIAL_BUFSIZE, shm_mq_handle::mqh_length_word_complete, shm_mq_handle::mqh_partial_bytes, shm_mq_handle::mqh_queue, MyProc, pfree(), pg_nextpower2_size_t, res, shm_mq_counterparty_gone(), SHM_MQ_DETACHED, shm_mq_get_sender(), shm_mq_inc_bytes_read(), shm_mq_receive_bytes(), SHM_MQ_SUCCESS, shm_mq_wait_internal(), and SHM_MQ_WOULD_BLOCK.
Referenced by copy_messages(), HandleParallelApplyMessages(), HandleParallelMessages(), LogicalParallelApplyLoop(), test_shm_mq(), test_shm_mq_pipelined(), and TupleQueueReaderNext().
shm_mq_result shm_mq_send | ( | shm_mq_handle * | mqh, |
Size | nbytes, | ||
const void * | data, | ||
bool | nowait, | ||
bool | force_flush | ||
) |
Definition at line 329 of file shm_mq.c.
References shm_mq_iovec::data, data, shm_mq_iovec::len, and shm_mq_sendv().
Referenced by copy_messages(), pa_send_data(), test_shm_mq(), test_shm_mq_pipelined(), and tqueueReceiveSlot().
shm_mq_result shm_mq_sendv | ( | shm_mq_handle * | mqh, |
shm_mq_iovec * | iov, | ||
int | iovcnt, | ||
bool | nowait, | ||
bool | force_flush | ||
) |
Definition at line 361 of file shm_mq.c.
References Assert, shm_mq_iovec::data, data, ereport, errcode(), errmsg(), ERROR, i, j, shm_mq_iovec::len, len, MAXALIGN_DOWN, MaxAllocSize, shm_mq::mq_detached, shm_mq::mq_mutex, shm_mq::mq_receiver, shm_mq::mq_ring_size, shm_mq::mq_sender, shm_mq_handle::mqh_counterparty_attached, shm_mq_handle::mqh_length_word_complete, shm_mq_handle::mqh_partial_bytes, shm_mq_handle::mqh_queue, shm_mq_handle::mqh_send_pending, MyProc, PGPROC::procLatch, res, SetLatch(), SHM_MQ_DETACHED, shm_mq_inc_bytes_written(), shm_mq_send_bytes(), SHM_MQ_SUCCESS, SpinLockAcquire, SpinLockRelease, and tmpbuf.
Referenced by mq_putmessage(), and shm_mq_send().
void shm_mq_set_handle | ( | shm_mq_handle * | mqh, |
BackgroundWorkerHandle * | handle | ||
) |
Definition at line 319 of file shm_mq.c.
References Assert, and shm_mq_handle::mqh_handle.
Referenced by ExecParallelCreateReaders(), and LaunchParallelWorkers().
Definition at line 206 of file shm_mq.c.
References Assert, shm_mq::mq_mutex, shm_mq::mq_receiver, shm_mq::mq_sender, PGPROC::procLatch, SetLatch(), SpinLockAcquire, and SpinLockRelease.
Referenced by attach_to_queues(), ExecParallelSetupTupleQueues(), InitializeParallelDSM(), pa_setup_dsm(), ParallelApplyWorkerMain(), ReinitializeParallelDSM(), and setup_dynamic_shared_memory().
Definition at line 224 of file shm_mq.c.
References Assert, shm_mq::mq_mutex, shm_mq::mq_receiver, shm_mq::mq_sender, PGPROC::procLatch, SetLatch(), SpinLockAcquire, and SpinLockRelease.
Referenced by attach_to_queues(), ExecParallelGetReceiver(), pa_setup_dsm(), ParallelApplyWorkerMain(), ParallelWorkerMain(), and setup_dynamic_shared_memory().
shm_mq_result shm_mq_wait_for_attach | ( | shm_mq_handle * | mqh | ) |
Definition at line 820 of file shm_mq.c.
References Assert, shm_mq::mq_receiver, shm_mq::mq_sender, shm_mq_handle::mqh_handle, shm_mq_handle::mqh_queue, MyProc, SHM_MQ_DETACHED, shm_mq_get_receiver(), shm_mq_get_sender(), SHM_MQ_SUCCESS, and shm_mq_wait_internal().
|
extern |
Definition at line 168 of file shm_mq.c.
Referenced by setup_dynamic_shared_memory().