sync.c File Reference

Implementation of the synchorinzation thread. More...

Go to the source code of this file.

Functions

static void __wakeup_and_map (dsi_socket_t *socket, dsi_packet_t *packet)
 Send reply to remote work thread (receiver), map packet data.
static void __wakeup_and_copy (dsi_socket_t *socket, dsi_packet_t *packet)
 Send reply to remote work thread (receiver), copy packet data.
void dsi_sync_thread_send (void *data)
 Synchronization thread, send component.
void dsi_sync_thread_receive (void *data)
 Synchronization thread, receive component.
int dsi_start_sync_thread (dsi_socket_t *socket)
 Send connect message to synchronization thread.


Detailed Description

Implementation of the synchorinzation thread.

Date:
07/08/2000
Author:
Lars Reuther <reuther@os.inf.tu-dresden.de>
This thread handles the synchronization messages from the remote work thread. They are send if the work thread of the remote component waits for a packet to be commited by the local work thread. If the specified packet is not commited yet, the wait flag is set locally in the packet flags and the remote work thread stays in its ipc-call until the local work thread commited the packet an send the wakeup message to us (the synchronization thread).

If the synchronization thread receives the wakeup message for a packet (from the local work thread) and the wait flag is not set, the notification pending flag is set in the packet flags and a subsequent synchronization call of the remote work thread returns immediately. This situation can happen if the remote work thread is preemted in the middle of dsi_down.

Currently we have two versions of the synchronization thread, one for send components and one for receive components. While the sync thread of a receive component just handles wait requests for packets to be acknowledged by the receive component, the sync thread of a send component also implements the mapping/copying of data to the receiver.

Todo:
Check packet number, especially if provided by the remote component
Note:
It is perfectly legal for the remote component to abort an ongoing dsi_down() due to the end of transmission. This means, our unblock- IPC may fail. This is not indicated by the packet_commit() function, nor can it be found out somehow else.

Definition in file sync.c.


Function Documentation

static void __wakeup_and_copy ( dsi_socket_t socket,
dsi_packet_t packet 
) [inline, static]

Send reply to remote work thread (receiver), copy packet data.

Parameters:
socket Socket descriptor
packet Packet descriptor

Definition at line 113 of file sync.c.

References dsi_sg_elem::addr, dsi_socket::data_area, dsi_socket::remote_socket, dsi_packet::sg_len, dsi_packet::sg_list, dsi_socket::sg_lists, dsi_sg_elem::size, and dsi_socket_ref::work_th.

Referenced by dsi_sync_thread_send().

static void __wakeup_and_map ( dsi_socket_t socket,
dsi_packet_t packet 
) [inline, static]

Send reply to remote work thread (receiver), map packet data.

Parameters:
socket Socket descriptor
packet Packet descriptor

Definition at line 69 of file sync.c.

References dsi_sg_elem::addr, dsi_socket::data_area, dsi_packet::no, dsi_socket::remote_socket, dsi_packet::sg_len, dsi_packet::sg_list, dsi_socket::sg_lists, dsi_sg_elem::size, and dsi_socket_ref::work_th.

Referenced by dsi_sync_thread_send().

void dsi_sync_thread_send ( void *  data  ) 

Synchronization thread, send component.

Parameters:
data thread data, pointer to socket descriptor

Definition at line 157 of file sync.c.

References __wakeup_and_copy(), __wakeup_and_map(), dsi_socket::flags, dsi_packet::flags, dsi_packet::no, dsi_socket::packets, dsi_socket::release_callback, dsi_socket::remote_socket, dsi_socket_ref::socket, dsi_socket::work_th, and dsi_socket_ref::work_th.

Referenced by dsi_create_sync_thread().


Generated on Wed Apr 11 06:40:14 2012 for DSI - Drops Streaming Interface by  doxygen 1.5.6