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"
17 #include "rb_msg_host.h"
20 /**************************************************************************
21 There are 2 section in This File:
23 1 - Functions to Manage The Ruby Process >> Up Call
24 2 - Functions to Manage The Native Process Simulation Bound >> Down Call
26 ***************************************************************************/
27 // Init Ruby : To Call Ruby Methods From C
29 static void initRuby();
31 /***********************************************
33 Functions for Ruby Process Management ( Up Call )
37 ************************************************/
40 static VALUE process_getName( VALUE ruby_process );
43 static VALUE process_getID(VALUE ruby_process);
45 // Get Bind : return the ID of Bind member
46 static VALUE process_getBind(VALUE ruby_class);
49 static void process_setBind(VALUE ruby_class,long bind);
52 static VALUE process_isAlive(VALUE ruby_process);
55 static void process_kill(VALUE ruby_process);
58 static void process_join( VALUE ruby_process );
61 static void process_unschedule( VALUE ruby_process );
64 static void process_schedule( VALUE ruby_process );
69 /***************************************************
71 Function for Native Process ( Bound ) Management
73 Methods Belong to The MSG Module
74 ****************************************************/
76 // ProcessBind Method ; Process Ruby >> Process C
78 //friend Method // Not belong to the Class but Called within !!
79 static m_process_t process_to_native(VALUE ruby_process);
81 // Binding Process >> Friend Method
82 static void processBind(VALUE ruby_class,m_process_t process);
84 // CreateProcess Method
85 static void processCreate(VALUE Class,VALUE rb_process,VALUE host);
88 static void processSuspend(VALUE Class,VALUE ruby_process);
91 static void processResume(VALUE Class,VALUE ruby_process);
93 //ProcessIsSuspend return Boolean ( Qtrue / Qfalse )
94 static VALUE processIsSuspend(VALUE Class,VALUE ruby_process);
97 static void processKill(VALUE Class,VALUE ruby_process);
100 static VALUE processGetHost(VALUE Class,VALUE ruby_process);
103 static void processExit(VALUE Class,VALUE ruby_process);