GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MESG_PORT(3) FreeBSD Library Functions Manual MESG_PORT(3)

mesg_port
generic message ports

PDEL Library (libpdel, -lpdel)

#include <pthread.h>
#include <pdel/util/mesg_port.h>

struct mesg_port *
mesg_port_create(const char *mtype);

void
mesg_port_destroy(struct mesg_port **portp);

int
mesg_port_put(struct mesg_port *port, void *data);

void *
mesg_port_get(struct mesg_port *port, int timeout);

u_int
mesg_port_qlen(struct mesg_port *port);

These functions implement a message port for inter-thread communication.

mesg_port_create() creates a new messge port, using typed_mem(3) type mtype for internal memory allocation.

mesg_port_destroy() destroys the message port pointed to by *portp. There must be no messages in the message port, otherwise mesg_port_destroy() aborts with an assertion failure. Upon return, *portp will be set to NULL. If *portp is already NULL when mesg_port_destroy() is invoked, nothing happens.

mesg_port_put() writes the message represented by data to the message port pointed to by port. The data may not be NULL.

mesg_port_get() retrieves the next available message written to the message port pointed to by port. Messages are read in the same order as they are written. If there are no messages, mesg_port_get() waits for up to timeout milliseconds, or indefinitely if timeout is negative. The thread calling mesg_port_get() may be canceled without ill effect.

mesg_port_qlen() returns the current number of messages queued on the message port pointed to by port.

mesg_port_put(), mesg_port_get(), and mesg_port_qlen() may be called safely at the same time from different threads.

mesg_port_create(), mesg_port_put(), and mesg_port_get() return NULL or -1 to indicate an error, with errno set appropriately.

libpdel(3), pevent(3), pthread(3), typed_mem(3)

The PDEL library was developed at Packet Design, LLC. http://www.packetdesign.com/

Archie Cobbs ⟨archie@freebsd.org⟩
April 22, 2002 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.