TAKTUK(3) | TakTuk Library Functions Manual | TAKTUK(3) |
taktuk - Interface library to "taktuk(1)" communication facilities
#include <taktuk.h> const char *taktuk_error_msg(int msg_code); int taktuk_init_threads(); int taktuk_leave_threads(); int taktuk_get(const char *field, unsigned long *result); int taktuk_multi_send(const char *dest, const char *target, const void *buffer, size_t length); int taktuk_multi_sendv(const char *dest, const char *target, const struct iovec *iov, int iovcnt); int taktuk_send(unsigned long dest, unsigned long target, const void *buffer, size_t length); int taktuk_sendv(unsigned long dest, unsigned long target, const struct iovec *iov, int iovcnt); int taktuk_recv(unsigned long *from, void *buffer, size_t *length, struct timeval *timeout); int taktuk_recvv(unsigned long *from, const struct iovec *iov, int iovcnt, struct timeval *timeout); int taktuk_wait_message(unsigned long *from, size_t *size, struct timeval *timeout); int taktuk_read( void *buffer, size_t length ); int taktuk_readv( const struct iovec *iov, int iovcnt );
The TakTuk communication layer interface library provides a way for programs executed using the taktuk(1) command to exchange data. It is based on a simple send/receive model using multicast-like sends and optionally timeouted receives. This is only designed to be a control facility, in particular this is not a high performance communication library.
Any program using TakTuk C communication interface has to link his program to the "taktuk" and "pthread" libraries (the "taktuk" library is provided with the distribution). Headers for communication functions and constants definitions can be found in "taktuk.h" also provided with the distribution.
The communication functions are:
Nevertheless, notice that, because of the way TakTuk is implemented, the handling of "recv" functions in several threads is completely sequentialized. This is especially important regarding timeouts: if a timeout is given to a "recv" function, it will only be started at the calling thread's turn. In other words, issuing multiple timeouted "recv" in several threads of the same process might result in timeouts longer that expected (they become at most the sum of all pending "recv" timeouts).
WARNING: the buffer size should be sufficient to receive all the data of the matching send. If this is not the case, the program is likely to end up abruptly with a segmentation fault.
If you don't know in advance the size of the data being sent to you, you can use these lower level functions. Actually, "taktuk_recv" is equivalent to a call to "taktuk_wait_message" followed by errors checks on buffer size and a call to "taktuk_read". This is the same for "taktuk_recvv".
When an error occur, all of these functions return one of the following numeric error code. A textual description of the error is provided by the function "taktuk_error_msg()" that takes the error code as an argument.
Error codes are the following :
Other error codes are internal TakTuk errors which should strongly suggest a bug in TakTuk. They have also a textual description that is returned by "taktuk_error_msg".
The original concept of TakTuk has been proposed by Cyrille Martin in his PhD thesis. People involved in this work include Jacques Briat, Olivier Richard, Thierry Gautier and Guillaume Huard.
The author of the version 3 (perl version) and current maintainer of the package is Guillaume Huard.
The "taktukcomm" communication interface library is provided under the terms of the GNU General Public License version 2 or later.
2019-07-18 | perl v5.28.1 |