Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Indent include and src using this command:
[simgrid.git] / src / include / simix / datatypes.h
1 /* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef SIMIX_DATATYPE_H
8 #define SIMIX_DATATYPE_H
9 #include "xbt/misc.h"
10 #include "xbt/swag.h"
11 #include "xbt/fifo.h"
12
13 SG_BEGIN_DECL()
14
15 /* ******************************** Host ************************************ */
16 /** @defgroup m_datatypes_management_details Details on SIMIX datatypes */
17 /** @brief Host datatype  
18     @ingroup m_datatypes_management
19
20     A <em>location</em> (or <em>host</em>) is any possible place where
21     a process may run. Thus it is represented as a <em>physical
22     resource with computing capabilities</em>, some <em>mailboxes</em>
23     to enable running process to communicate with remote ones, and
24     some <em>private data</em> that can be only accessed by local
25     process.
26
27     \see m_host_management
28   @{ */
29 typedef struct s_smx_host *smx_host_t;
30 /** @} */
31
32
33 /* ******************************** Syncro ************************************ */
34 typedef struct s_smx_mutex {
35   xbt_swag_t sleeping;          /* list of sleeping process */
36   int refcount;
37 } s_smx_mutex_t;
38 typedef s_smx_mutex_t *smx_mutex_t;
39
40 typedef struct s_smx_cond {
41   xbt_swag_t sleeping;          /* list of sleeping process */
42   smx_mutex_t mutex;
43   xbt_fifo_t actions;           /* list of actions */
44 } s_smx_cond_t;
45 typedef s_smx_cond_t *smx_cond_t;
46
47 typedef struct s_smx_sem {
48   xbt_fifo_t sleeping;          /* list of sleeping process */
49   int capacity;
50   xbt_fifo_t actions;           /* list of actions */
51 } s_smx_sem_t;
52 typedef s_smx_sem_t *smx_sem_t;
53
54 /********************************** Action *************************************/
55 typedef struct s_smx_action *smx_action_t;
56
57 /* ****************************** Process *********************************** */
58 /** @brief Agent datatype  
59     @ingroup m_datatypes_management 
60
61     An agent may be defined as a <em>code</em>, with some <em>private
62     data</em>, executing in a <em>location</em>.
63     \see m_process_management
64   @{ */
65 typedef struct s_smx_process *smx_process_t;
66 /** @} */
67
68 typedef struct s_smx_context *smx_context_t;
69
70 /******************************* Networking ***********************************/
71 typedef struct s_smx_rvpoint *smx_rdv_t;
72 typedef struct s_smx_comm *smx_comm_t;
73 typedef enum { comm_send,
74   comm_recv
75 } smx_comm_type_t;
76
77
78
79 SG_END_DECL()
80 #endif