7 #include "msg/datatypes.h"
9 #include "msg/private.h"
10 #include "msg/mailbox.h"
11 #include "surf/surfxml_parse.h"
12 #include "simix/simix.h"
13 #include "simix/private.h"
14 #include "xbt/sysdep.h"
16 #include "xbt/asserts.h"
18 #include "rb_msg_host.h"
21 /**************************************************************************
22 There are 2 section in This File:
24 1 - Functions to Manage The Ruby Process >> Up Call
25 2 - Functions to Manage The Native Process Simulation Bound >> Down Call
27 ***************************************************************************/
30 // Init Ruby : To Call Ruby Methods From C
32 static void initRuby();
34 /***********************************************
36 Functions for Ruby Process Management ( Up Call )
40 ************************************************/
43 static VALUE process_getName( VALUE ruby_process );
46 static VALUE process_getID(VALUE ruby_process);
48 // Get Bind : return the ID of Bind member
49 static VALUE process_getBind(VALUE ruby_class);
52 static void process_setBind(VALUE ruby_class,long bind);
55 static VALUE process_isAlive(VALUE ruby_process);
58 static void process_kill(VALUE ruby_process);
61 static void process_join( VALUE ruby_process );
64 static void process_unschedule( VALUE ruby_process );
67 static void process_schedule( VALUE ruby_process );
72 /***************************************************
74 Function for Native Process ( Bound ) Management
76 Methods Belong to The MSG Module
77 ****************************************************/
79 // ProcessBind Method ; Process Ruby >> Process C
81 //friend Method // Not belong to the Class but Called within !!
82 static m_process_t process_to_native(VALUE ruby_process);
84 // Binding Process >> Friend Method
85 static void processBind(VALUE ruby_class,m_process_t process);
87 // CreateProcess Method
88 static void processCreate(VALUE Class,VALUE rb_process,VALUE host);
91 static void processSuspend(VALUE Class,VALUE ruby_process);
94 static void processResume(VALUE Class,VALUE ruby_process);
96 //ProcessIsSuspend return Boolean ( Qtrue / Qfalse )
97 static VALUE processIsSuspend(VALUE Class,VALUE ruby_process);
100 static void processKill(VALUE Class,VALUE ruby_process);
103 static VALUE processGetHost(VALUE Class,VALUE ruby_process);