ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/docs/pws2004/goofed.mgp
Revision: 1.2
Committed: Mon Jun 28 17:12:45 2004 UTC (22 years, 3 months ago) by root
Branch: MAIN
Changes since 1.1: +1 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 %include "std.mgp"
2     %%default 1 bimage "gtk/gtk-window.jpg" 1024x768, center
3     %page
4 root 1.2 %charset "iso8859-1"
5 root 1.1 %%bimage "gtk/screenshot.jpg" 1600x1200
6    
7     %center
8     GOOFED
9    
10    
11     %center
12     Generic
13     Object
14     Oriented
15     Flexible
16     Extensible
17     Daemon
18    
19     Perl embedden... einmal anders!
20    
21     %page
22    
23     Wozu?
24    
25     %pause
26     Ersetzen eines bestehenden Servers
27     %pause
28     Langzeitstabilität
29     %pause
30     Effizienz & Skalierbarkeit
31     %pause
32     Algorithmen sollten einfach und klar ausdrückbar sein
33     %pause
34    
35     Vor- u. Nachteile von Perl:
36     %pause
37     Perl besitzt viele nützliche Module
38     %pause
39     Perl hat viele Abhängigkeiten (externe Dateien...)
40     %pause
41     Perl wird nicht häufig embeddet => wenig Beispiele
42     %pause
43     Perl stabil? Ja, aber nicht automatisch...
44    
45     %page
46    
47     Eckpunke der Implementation
48    
49     %pause
50     Einzelnes Binary
51     %pause
52     keine externen Dateien
53     %pause
54     auch nicht zur Laufzeit, wie PAR
55     %pause
56     Kein komplexes Build-System
57     %pause
58     Feste Perl-Version: Upgrade == Kopfschmerzen
59     %pause
60     Perl-Sourcen integriert
61     %pause
62     Ausgewählte Module
63     %pause
64     Coro
65    
66     %page
67    
68     Microperl
69    
70     %pause
71     µperl, bzw. uperl ist Teil der Perl-Distribution
72     %pause
73     README.micro, Makefile.micro, uconfig.sh
74     %pause
75     sehr spartanisch: C89 + ein bisschen POSIX
76    
77     %pause
78     Tuning
79     %font "t5"
80     <= -DPERL_CORE -DPERL_MICRO -DSTANDARD_C
81     -DPERL_USE_SAFE_PUTENV
82     => -DPERL_CORE=1 -DPERL_MICRO=1
83    
84     %pause
85     vi uconfig.sh
86    
87     %page
88    
89     Ergebnis
90    
91    
92     %pause
93     libuperl.a
94    
95     %pause
96     microperl
97    
98     %pause
99     Config.pm
100    
101     %page
102    
103     Bibliotheksdateien
104    
105     %font "t3"
106     UPERL = uperl/microperl -Ilib-perl
107    
108     src/libfiles.c: s/gen_libfiles extensions
109     $(UPERL) s/gen_libfiles >$@
110     %font "s"
111    
112     %pause
113     gen_libfiles erzeugt src/libfiles.c:
114    
115     %font "t3"
116     const char *embed_files[] = {
117     /* 0 */
118     "\025Attribute/Handlers.pm\000\000\030Apackage Attribute::Handlers;\01...
119     " "data eq 'ARRAY';\012\011\011\011\\$data = [ \\$data ] unless \\$wa...
120     ...
121     ,
122     };
123    
124     const int embed_file_num = 208;
125    
126     %page
127    
128     Module mit XS-Dateien
129    
130     %pause
131     ExtUtils::MakeMaker bietet Support für in-Tree-Builds
132     %pause
133     %font "t5"
134     $TOP/uperl/microperl -I$TOP/lib-perl
135     Makefile.PL INSTALLDIRS=perl
136     PERL_CORE=1 PERL_SRC=$TOP/uperl
137     PERL_LIB=$TOP/lib-perl
138     %font "s"
139    
140     %pause
141     Statische Module
142     %pause
143     %font "t5"
144     make CC=$(CC) OPTIMIZE=$(OPTIMIZE) LINKTYPE=static CCCDLFLAGS= static
145    
146     %page
147    
148     Linken
149    
150     %pause
151     %font "t4"
152     goofed: src/main.o src/xsinit.o src/libfiles.o extensions
153     $(CC) $(CFLAGS) -o $@ src/xsinit.o
154     `find lib-perl/auto -name '*.a' -print`
155     src/main.o src/libfiles.o uperl/libuperl.a
156     $(LIBS)
157     %font "s"
158    
159     %pause
160     xsinit.c enthält boot_Modulname Aufrufe, die die bootstrap-Funktionen registrieren:
161    
162     %pause
163     %font "t4"
164     newXS ("daemon::bootstrap", boot_daemon, file);
165     newXS ("re::bootstrap", boot_re, file);
166     newXS ("POSIX::bootstrap", boot_POSIX, file);
167     \# usw..
168    
169    
170     %page
171    
172     "Bootstrapping"
173    
174     %pause
175     %font "t4"
176     char *embed_argv[EMBED_ARGC] = {
177     "goofed", "-e", ....
178     };
179    
180     %pause
181     daemon->bootstrap (0);
182     PerlIO::scalar->bootstrap (0);
183     %pause
184     @INC = sub {
185     open my $fh, '<', \(daemon::libfile ($_[1]))
186     or die "FATAL: loader can't in-memory stream\n";
187     $fh;
188     };
189     %pause
190     require daemon;
191     daemon->init;
192    
193