Functions

/home/mesh/mesh/include/mesh_comm.h File Reference

MESH Communications Header. More...

Go to the source code of this file.

Functions

void mesh_comm_write (gchar *comm_thread, void *arg, mesh_shared_data *msd, gint blocking_mode)
 Simulates a write to the communication infrastructure. The behavior of this write is specified within a comm_thread which is identified by name. This API function will create an instance of a comm_thread and suspend the calling thread according to the blocking_mode specified. Depending on the comm_thread specified, additional arguments or shared data might be passed as well.
void mesh_comm_write_delayed (gchar *comm_thread, void *arg, mesh_shared_data *msd, gint blocking_mode)
 Performs mesh_comm_write() after the delay of the next consume call has been applied. For of arguments,.
void mesh_comm_read (gchar *comm_thread, void *arg, mesh_shared_data *msd, gint blocking_mode)
 Simulates a read to the communication infrastructure. The behavior of this read is specified within a comm_thread which is identified by name. This API function will create an instance of a comm_thread and suspend the calling thread according to the blocking_mode specified. Depending on the comm_thread specified, additional arguments or shared data might be passed as well.
void mesh_comm_read_delayed (gchar *comm_thread, void *arg, mesh_shared_data *msd, gint blocking_mode)
 Performs mesh_comm_read() after the delay of the next consume call has been applied. For of arguments,.
void mesh_create_comm_thread (gchar *name, mesh_scheduler *cs, void *(*thread)(void *))
 Creates a communication threads. Unlike conventional execution threads, a creation of a communication thread does not automatically start the thread and make it eligible to run. Instead, the thread is registered with the simulator and is available to be started via mesh_comm_read and mesh_comm_write calls.

Detailed Description

MESH Communications Header.


Function Documentation

void mesh_comm_read ( gchar *  comm_thread,
void *  arg,
mesh_shared_data *  msd,
gint  blocking_mode 
)

Simulates a read to the communication infrastructure. The behavior of this read is specified within a comm_thread which is identified by name. This API function will create an instance of a comm_thread and suspend the calling thread according to the blocking_mode specified. Depending on the comm_thread specified, additional arguments or shared data might be passed as well.

Parameters:
comm_thread Name of the communication thread that will model the functionality of this read call
arg An optional argument to the communication thread
msd A shared data entity that allows data to be passed through mesh_comm_read or mesh_comm_write calls
blocking_mode Defines what happens to the calling execution thread while a comm thread is executing. BLOCK_RESOURCE -- the resource running the execution thread will not be able to run until the comm thread has completed. BLOCK_THREAD -- the execution thread must wait for the comm thread, but the resource does not (i.e. resource can context switch to another thread while waiting for communication). NO_BLOCKING -- the execution thread is allowed to run without having to wait for the comm thread. precond The comm_thread must be created via mesh_create_comm_thread().
See also:
mesh_create_comm_thread(), mesh_comm_read_delayed(), mesh_comm_write(), mesh_comm_write_delayed()
void mesh_comm_read_delayed ( gchar *  comm_thread,
void *  arg,
mesh_shared_data *  msd,
gint  blocking_mode 
)

Performs mesh_comm_read() after the delay of the next consume call has been applied. For of arguments,.

See also:
the entry for mesh_comm_read().
mesh_create_comm_thread(), mesh_comm_read(), mesh_comm_write(), mesh_comm_write_delayed()
void mesh_comm_write ( gchar *  comm_thread,
void *  arg,
mesh_shared_data *  msd,
gint  blocking_mode 
)

Simulates a write to the communication infrastructure. The behavior of this write is specified within a comm_thread which is identified by name. This API function will create an instance of a comm_thread and suspend the calling thread according to the blocking_mode specified. Depending on the comm_thread specified, additional arguments or shared data might be passed as well.

label mesh_comm_write

Parameters:
comm_thread Name of the communication thread that will model the functionality of this read call
arg An optional argument to the communication thread
msd A shared data entity that allows data to be passed through mesh_comm_read or mesh_comm_write calls
blocking_mode Defines what happens to the calling execution thread while a comm thread is executing. See mesh_comm_read() for more information. precond The comm_thread must be created via mesh_create_comm_thread().
See also:
mesh_create_comm_thread(), mesh_comm_write_delayed(), mesh_comm_read(), mesh_comm_read_delayed()
void mesh_comm_write_delayed ( gchar *  comm_thread,
void *  arg,
mesh_shared_data *  msd,
gint  blocking_mode 
)

Performs mesh_comm_write() after the delay of the next consume call has been applied. For of arguments,.

label mesh_comm_write_delayed

See also:
the entry for mesh_comm_write().
mesh_create_comm_thread(), mesh_comm_read(), mesh_comm_write(), mesh_comm_read_delayed()
void mesh_create_comm_thread ( gchar *  name,
mesh_scheduler *  cs,
void *(*)(void *)  thread 
)

Creates a communication threads. Unlike conventional execution threads, a creation of a communication thread does not automatically start the thread and make it eligible to run. Instead, the thread is registered with the simulator and is available to be started via mesh_comm_read and mesh_comm_write calls.

label mesh_create_comm_thread

Parameters:
name Name of the thread
ms Pointer to the mesh_scheduler that will serve as the default scheduler for this thread
(*thread) Function pointer to the function that implements the comm thread functionality.
See also:
mesh_comm_read(), mesh_comm_read_delayed(), mesh_comm_write(), mesh_comm_write_delayed()
 All Files Functions