mtcp_create_context

NAME

mtcp_create_context − create mTCP context for network communication

SYNOPSIS

#include <mtcp_api.h>

mctx_t mtcp_create_context(int cpu);

DESCRIPTION

mtcp_create_context() creates the underlying mTCP stack based on the parameters passed by the mtcp_init() function call. Each mTCP thread requires its own exclusive invocation of the mtcp_create_context() routine before the stack can be used for network communication. The function requires a sole cpu integer argument that passes the CPU core-id of the system on which the stack is instantiated.

RETURN VALUE

Returns mctx on success; NULL on failure. Please see the NOTES section for details.

NOTES

The user cannot call mtcp_create_context() function more than once using the same cpu-id in a process.

Passing an invalid CPU core-id (value < 0 or value > max_cpus) will prevent the creation of the mTCP stack.

It is suggested that the user creates only 1 mTCP context thread per core for performance reasons.

AUTHORS

mOS development team <mtcp-user@list.ndsl.kaist.edu>

EXAMPLES

http://mos.kaist.edu/guide/programmer/05_api_example.html#per-core-initialization-routine

SEE ALSO

mtcp_destroy_context(), mtcp_init(), mtcp_destroy()

COLOPHON

This page is part of mOS release 0.3 docs section. A description of the project, and information about reporting bugs, can be found at http://mos.kaist.edu/.