jekyll-theme-gaeblogx 0.2 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +63 -5
- data/assets/page/{4about.html → 4about.md} +0 -0
- metadata +2 -100
- data/assets/10.jpg +0 -0
- data/assets/AWS-Introduction-ec2.png +0 -0
- data/assets/Cache-Oblivious-Algorithms-FunnelSort.jpg +0 -0
- data/assets/Condition-Variables-fig1.png +0 -0
- data/assets/Dynamic-Compilation-adaptJVM.pdf +0 -0
- data/assets/Dynamic-Compilation-dyncomp.pdf +0 -0
- data/assets/Fibonacci-Heap-Fig3.png +0 -0
- data/assets/Fibonacci-Heap-Fig5.png +0 -0
- data/assets/Fibonacci-Heap-Fig6.png +0 -0
- data/assets/Fibonacci-Heap-Fig7.png +0 -0
- data/assets/File-System-bc.jpg +0 -0
- data/assets/File-System-filetable.rich.jpg +0 -0
- data/assets/GIL-Battle.png +0 -0
- data/assets/GIL-CPU.png +0 -0
- data/assets/GIL-Check.png +0 -0
- data/assets/GIL-IO.png +0 -0
- data/assets/GIL-Measure-1.png +0 -0
- data/assets/GIL-Measure-2.png +0 -0
- data/assets/GIL-Signal.png +0 -0
- data/assets/GIL-Tick.png +0 -0
- data/assets/Garbage-Collection-Slides-gc.pdf +0 -0
- data/assets/Garbage-Collection-copying-1.png +0 -0
- data/assets/Garbage-Collection-copying-2.png +0 -0
- data/assets/Garbage-Collection-free-list.png +0 -0
- data/assets/Garbage-Collection-generation-1.png +0 -0
- data/assets/Garbage-Collection-mark-sweep.png +0 -0
- data/assets/Garbage-Collection-nursery-1.png +0 -0
- data/assets/Garbage-Collection-nursery-2.png +0 -0
- data/assets/Garbage-Collection-nursery-3.png +0 -0
- data/assets/Garbage-Collection-nursery-4.png +0 -0
- data/assets/Garbage-Collection-nursery-5.png +0 -0
- data/assets/Garbage-Collection-process.png +0 -0
- data/assets/Garbage-Collection-ref-counting.png +0 -0
- data/assets/Interpreter-Optimization-interp.pdf +0 -0
- data/assets/Memory-Management-fig1.png +0 -0
- data/assets/Memory-Management-fig2.png +0 -0
- data/assets/Memory-Management-fig3.png +0 -0
- data/assets/Memory-Management-fig4.png +0 -0
- data/assets/Memory-Management-fig5.png +0 -0
- data/assets/Memory-Management-fig6.png +0 -0
- data/assets/Memory-Management-fig7.png +0 -0
- data/assets/Memory-Management-fig8.png +0 -0
- data/assets/Multicore-GIL-1.png +0 -0
- data/assets/Multicore-GIL-2.png +0 -0
- data/assets/My-Photo.JPG +0 -0
- data/assets/Operating-System-Virtualization-ept.png +0 -0
- data/assets/Operating-System-Virtualization-guest-page.png +0 -0
- data/assets/Operating-System-Virtualization-kvm-arch.png +0 -0
- data/assets/Operating-System-Virtualization-kvm-process.png +0 -0
- data/assets/Operating-System-Virtualization-kvm-qemu.png +0 -0
- data/assets/Operating-System-Virtualization-kvm-state.png +0 -0
- data/assets/Operating-System-Virtualization-vtx.png +0 -0
- data/assets/Operating-System-Virtualization-xen-arch.png +0 -0
- data/assets/Program-Profiling-profiling.pdf +0 -0
- data/assets/Programming-Language-Virtual-Machine-vm.pdf +0 -0
- data/assets/Remote-Shell-Session-Setup-1.png +0 -0
- data/assets/Signals-1.png +0 -0
- data/assets/Signals-2.png +0 -0
- data/assets/Signals-3.png +0 -0
- data/assets/Some-Slides-about-Containers-Kubernetes.pdf +0 -0
- data/assets/Some-Slides-about-Containers-UCSB-nurmi.pdf +0 -0
- data/assets/Some-Slides-about-PaaS-CS293B_CloudPlatforms.pdf +0 -0
- data/assets/avg-1thread.c +0 -172
- data/assets/avg-manythread.c +0 -284
- data/assets/avg-nothread.c +0 -71
- data/assets/file-create1.c +0 -75
- data/assets/file-create2.c +0 -120
- data/assets/file-fd1.c +0 -56
- data/assets/file-fd2.c +0 -25
- data/assets/file-fd3.c +0 -23
- data/assets/file-read1.c +0 -62
- data/assets/file-read2.c +0 -66
- data/assets/file-seek1.c +0 -87
- data/assets/fork-1.c +0 -35
- data/assets/fork-2.c +0 -44
- data/assets/fork-3.c +0 -60
- data/assets/fork-4.c +0 -64
- data/assets/joinall-1.c +0 -163
- data/assets/joinall-2.c +0 -162
- data/assets/market-kthreads.c +0 -465
- data/assets/market-semaphore.c +0 -504
- data/assets/market1.c +0 -478
- data/assets/market2.c +0 -490
- data/assets/market3.c +0 -503
- data/assets/market4.c +0 -509
- data/assets/my-cat.c +0 -35
- data/assets/pipe-1.c +0 -45
- data/assets/pipe-2.c +0 -80
- data/assets/pipe-3.c +0 -83
- data/assets/pipe-4.c +0 -116
- data/assets/race1.c +0 -75
- data/assets/race2.c +0 -77
- data/assets/race3.c +0 -87
- data/assets/race_ABC.c +0 -144
- data/assets/semaphore.book.ps +0 -8827
- data/assets/sys-call1.c +0 -20
- data/assets/sys-call2.c +0 -16
- data/assets//350/265/253/347/202/2161.PNG +0 -0
data/assets/file-fd1.c
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
#include <unistd.h>
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include <stdio.h>
|
4
|
-
#include <string.h>
|
5
|
-
#include <fcntl.h>
|
6
|
-
|
7
|
-
/*
|
8
|
-
* print out some file descriptors
|
9
|
-
*/
|
10
|
-
int main(int argc, char **argv)
|
11
|
-
{
|
12
|
-
int my_file_desc;
|
13
|
-
char file_name[4096];
|
14
|
-
int i;
|
15
|
-
int r;
|
16
|
-
char *string;
|
17
|
-
|
18
|
-
if(argc < 2) {
|
19
|
-
printf("need to specify a file name\n");
|
20
|
-
exit(1);
|
21
|
-
}
|
22
|
-
|
23
|
-
/*
|
24
|
-
* zero out the buffer for the file name
|
25
|
-
*/
|
26
|
-
for(i=0; i < sizeof(file_name); i++) {
|
27
|
-
file_name[i] = 0;
|
28
|
-
}
|
29
|
-
|
30
|
-
/*
|
31
|
-
* copy the argument into a local buffer
|
32
|
-
*/
|
33
|
-
strncpy(file_name,argv[1],sizeof(file_name));
|
34
|
-
file_name[sizeof(file_name)-1] = 0;
|
35
|
-
|
36
|
-
/*
|
37
|
-
* try and open the file for reading
|
38
|
-
*/
|
39
|
-
my_file_desc = open(file_name,O_RDONLY,0);
|
40
|
-
if(my_file_desc < 0) {
|
41
|
-
printf("failed to open %s for reading\n",file_name);
|
42
|
-
exit(1);
|
43
|
-
}
|
44
|
-
|
45
|
-
printf("my_file_desc: %d\n",my_file_desc);
|
46
|
-
|
47
|
-
string = "a string written to standard out\n";
|
48
|
-
write(1,string,strlen(string));
|
49
|
-
|
50
|
-
close(my_file_desc);
|
51
|
-
|
52
|
-
return(0);
|
53
|
-
|
54
|
-
}
|
55
|
-
|
56
|
-
|
data/assets/file-fd2.c
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#include <unistd.h>
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include <stdio.h>
|
4
|
-
#include <string.h>
|
5
|
-
#include <fcntl.h>
|
6
|
-
|
7
|
-
/*
|
8
|
-
* write to stdout and stderr
|
9
|
-
*/
|
10
|
-
int main(int argc, char **argv)
|
11
|
-
{
|
12
|
-
char *string;
|
13
|
-
char *string_err;
|
14
|
-
|
15
|
-
string = "a string written to standard out\n";
|
16
|
-
write(1,string,strlen(string));
|
17
|
-
|
18
|
-
string_err = "a string written to standard error\n";
|
19
|
-
write(2,string_err,strlen(string_err));
|
20
|
-
|
21
|
-
return(0);
|
22
|
-
|
23
|
-
}
|
24
|
-
|
25
|
-
|
data/assets/file-fd3.c
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
#include <unistd.h>
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include <stdio.h>
|
4
|
-
#include <string.h>
|
5
|
-
#include <fcntl.h>
|
6
|
-
|
7
|
-
/*
|
8
|
-
* read from stdin and write to stdout
|
9
|
-
*/
|
10
|
-
int main(int argc, char **argv)
|
11
|
-
{
|
12
|
-
char buffer[4096];
|
13
|
-
|
14
|
-
memset(buffer,0,sizeof(buffer));
|
15
|
-
|
16
|
-
read(0,buffer,sizeof(buffer));
|
17
|
-
write(1,buffer,strlen(buffer));
|
18
|
-
|
19
|
-
return(0);
|
20
|
-
|
21
|
-
}
|
22
|
-
|
23
|
-
|
data/assets/file-read1.c
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
#include <unistd.h>
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include <stdio.h>
|
4
|
-
#include <string.h>
|
5
|
-
#include <fcntl.h>
|
6
|
-
|
7
|
-
/*
|
8
|
-
* open and read the contents of a file, printing them out as ascii
|
9
|
-
* characters
|
10
|
-
*/
|
11
|
-
int main(int argc, char **argv)
|
12
|
-
{
|
13
|
-
int my_file_desc;
|
14
|
-
char file_name[4096];
|
15
|
-
char read_buffer[4096];
|
16
|
-
int i;
|
17
|
-
int r;
|
18
|
-
|
19
|
-
if(argc < 2) {
|
20
|
-
printf("need to specify a file name as the first argument\n");
|
21
|
-
exit(1);
|
22
|
-
}
|
23
|
-
|
24
|
-
/*
|
25
|
-
* zero out the buffer for the file name
|
26
|
-
*/
|
27
|
-
for(i=0; i < sizeof(file_name); i++) {
|
28
|
-
file_name[i] = 0;
|
29
|
-
}
|
30
|
-
|
31
|
-
/*
|
32
|
-
* copy the argument into a local buffer
|
33
|
-
*/
|
34
|
-
strncpy(file_name,argv[1],sizeof(file_name));
|
35
|
-
file_name[sizeof(file_name)-1] = 0;
|
36
|
-
|
37
|
-
/*
|
38
|
-
* try and open the file for reading
|
39
|
-
*/
|
40
|
-
my_file_desc = open(file_name,O_RDONLY,0);
|
41
|
-
if(my_file_desc < 0) {
|
42
|
-
printf("failed to open %s for reading\n",file_name);
|
43
|
-
exit(1);
|
44
|
-
}
|
45
|
-
|
46
|
-
for(i=0; i < sizeof(read_buffer); i++) {
|
47
|
-
read_buffer[i] = 0;
|
48
|
-
}
|
49
|
-
|
50
|
-
r = read(my_file_desc,read_buffer,sizeof(read_buffer)-1);
|
51
|
-
|
52
|
-
printf("file: %s contains the string: %s\n",
|
53
|
-
file_name,
|
54
|
-
read_buffer);
|
55
|
-
|
56
|
-
close(my_file_desc);
|
57
|
-
|
58
|
-
return(0);
|
59
|
-
|
60
|
-
}
|
61
|
-
|
62
|
-
|
data/assets/file-read2.c
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
#include <unistd.h>
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include <stdio.h>
|
4
|
-
#include <string.h>
|
5
|
-
#include <fcntl.h>
|
6
|
-
|
7
|
-
/*
|
8
|
-
* read the file in its entirety (like the cat utility)
|
9
|
-
*/
|
10
|
-
int main(int argc, char **argv)
|
11
|
-
{
|
12
|
-
int my_file_desc;
|
13
|
-
char file_name[4096];
|
14
|
-
char read_buffer[4096];
|
15
|
-
int i;
|
16
|
-
int r;
|
17
|
-
|
18
|
-
if(argc < 2) {
|
19
|
-
printf("need to specify a file name as the first argument\n");
|
20
|
-
exit(1);
|
21
|
-
}
|
22
|
-
|
23
|
-
/*
|
24
|
-
* zero out the buffer for the file name
|
25
|
-
*/
|
26
|
-
for(i=0; i < sizeof(file_name); i++) {
|
27
|
-
file_name[i] = 0;
|
28
|
-
}
|
29
|
-
|
30
|
-
/*
|
31
|
-
* copy the argument into a local buffer
|
32
|
-
*/
|
33
|
-
strncpy(file_name,argv[1],sizeof(file_name));
|
34
|
-
file_name[sizeof(file_name)-1] = 0;
|
35
|
-
|
36
|
-
/*
|
37
|
-
* try and open the file for reading
|
38
|
-
*/
|
39
|
-
my_file_desc = open(file_name,O_RDONLY,0);
|
40
|
-
if(my_file_desc < 0) {
|
41
|
-
printf("failed to open %s for reading\n",file_name);
|
42
|
-
exit(1);
|
43
|
-
}
|
44
|
-
|
45
|
-
for(i=0; i < sizeof(read_buffer); i++) {
|
46
|
-
read_buffer[i] = 0;
|
47
|
-
}
|
48
|
-
r = read(my_file_desc,read_buffer,sizeof(read_buffer)-1);
|
49
|
-
|
50
|
-
/*
|
51
|
-
* read and print until EOF
|
52
|
-
*/
|
53
|
-
while(r > 0) {
|
54
|
-
printf("%s",read_buffer);
|
55
|
-
for(i=0; i < sizeof(read_buffer); i++) {
|
56
|
-
read_buffer[i] = 0;
|
57
|
-
}
|
58
|
-
r = read(my_file_desc,read_buffer,sizeof(read_buffer)-1);
|
59
|
-
}
|
60
|
-
close(my_file_desc);
|
61
|
-
|
62
|
-
return(0);
|
63
|
-
|
64
|
-
}
|
65
|
-
|
66
|
-
|
data/assets/file-seek1.c
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
#include <unistd.h>
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include <stdio.h>
|
4
|
-
#include <string.h>
|
5
|
-
#include <fcntl.h>
|
6
|
-
|
7
|
-
/*
|
8
|
-
* seek the file in the first argument to the location specified in the
|
9
|
-
* second
|
10
|
-
*/
|
11
|
-
int main(int argc, char **argv)
|
12
|
-
{
|
13
|
-
int my_file_desc;
|
14
|
-
char file_name[4096];
|
15
|
-
char read_buffer[4096];
|
16
|
-
int i;
|
17
|
-
int r;
|
18
|
-
off_t offset;
|
19
|
-
off_t where;
|
20
|
-
|
21
|
-
if(argc < 3) {
|
22
|
-
printf("need to specify a file name and an offset\n");
|
23
|
-
exit(1);
|
24
|
-
}
|
25
|
-
|
26
|
-
/*
|
27
|
-
* zero out the buffer for the file name
|
28
|
-
*/
|
29
|
-
for(i=0; i < sizeof(file_name); i++) {
|
30
|
-
file_name[i] = 0;
|
31
|
-
}
|
32
|
-
|
33
|
-
/*
|
34
|
-
* copy the argument into a local buffer
|
35
|
-
*/
|
36
|
-
strncpy(file_name,argv[1],sizeof(file_name));
|
37
|
-
file_name[sizeof(file_name)-1] = 0;
|
38
|
-
|
39
|
-
/*
|
40
|
-
* get the offset from the second argument
|
41
|
-
*/
|
42
|
-
offset = (off_t)atoi(argv[2]);
|
43
|
-
|
44
|
-
/*
|
45
|
-
* try and open the file for reading
|
46
|
-
*/
|
47
|
-
my_file_desc = open(file_name,O_RDONLY,0);
|
48
|
-
if(my_file_desc < 0) {
|
49
|
-
printf("failed to open %s for reading\n",file_name);
|
50
|
-
exit(1);
|
51
|
-
}
|
52
|
-
|
53
|
-
/*
|
54
|
-
* seek to the offset specified in the second argument
|
55
|
-
*/
|
56
|
-
where = lseek(my_file_desc,offset,SEEK_SET);
|
57
|
-
|
58
|
-
if(where < 0) {
|
59
|
-
printf("lseek to %d in file %s failed\n",
|
60
|
-
(int)offset,
|
61
|
-
file_name);
|
62
|
-
close(my_file_desc);
|
63
|
-
exit(1);
|
64
|
-
}
|
65
|
-
|
66
|
-
for(i=0; i < sizeof(read_buffer); i++) {
|
67
|
-
read_buffer[i] = 0;
|
68
|
-
}
|
69
|
-
r = read(my_file_desc,read_buffer,sizeof(read_buffer)-1);
|
70
|
-
|
71
|
-
/*
|
72
|
-
* read and print until EOF
|
73
|
-
*/
|
74
|
-
while(r > 0) {
|
75
|
-
printf("%s",read_buffer);
|
76
|
-
for(i=0; i < sizeof(read_buffer); i++) {
|
77
|
-
read_buffer[i] = 0;
|
78
|
-
}
|
79
|
-
r = read(my_file_desc,read_buffer,sizeof(read_buffer)-1);
|
80
|
-
}
|
81
|
-
close(my_file_desc);
|
82
|
-
|
83
|
-
return(0);
|
84
|
-
|
85
|
-
}
|
86
|
-
|
87
|
-
|
data/assets/fork-1.c
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
#include <unistd.h>
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include <stdio.h>
|
4
|
-
#include <string.h>
|
5
|
-
#include <fcntl.h>
|
6
|
-
|
7
|
-
/*
|
8
|
-
* simple program calling fork
|
9
|
-
*/
|
10
|
-
int main(int argc, char **argv)
|
11
|
-
{
|
12
|
-
pid_t child_id;
|
13
|
-
pid_t my_id;
|
14
|
-
|
15
|
-
my_id = getpid();
|
16
|
-
printf("pid: %d -- I am the parent about to call fork\n",
|
17
|
-
(int)my_id);
|
18
|
-
|
19
|
-
child_id = fork();
|
20
|
-
if(child_id != 0) {
|
21
|
-
my_id = getpid();
|
22
|
-
printf("pid: %d -- I just forked a child with id %d\n",
|
23
|
-
(int)my_id,
|
24
|
-
(int)child_id);
|
25
|
-
} else {
|
26
|
-
my_id = getpid();
|
27
|
-
printf("pid: %d -- I am the child\n",my_id);
|
28
|
-
}
|
29
|
-
|
30
|
-
printf("pid: %d -- I am exiting\n",my_id);
|
31
|
-
exit(0);
|
32
|
-
|
33
|
-
}
|
34
|
-
|
35
|
-
|
data/assets/fork-2.c
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
#include <unistd.h>
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include <stdio.h>
|
4
|
-
#include <string.h>
|
5
|
-
#include <fcntl.h>
|
6
|
-
|
7
|
-
/*
|
8
|
-
* simple program calling fork and wait
|
9
|
-
*/
|
10
|
-
int main(int argc, char **argv)
|
11
|
-
{
|
12
|
-
pid_t child_id;
|
13
|
-
pid_t my_id;
|
14
|
-
int child_status;
|
15
|
-
int i;
|
16
|
-
|
17
|
-
child_id = fork();
|
18
|
-
if(child_id != 0) {
|
19
|
-
my_id = getpid();
|
20
|
-
printf("pid: %d -- I just forked a child with id %d\n",
|
21
|
-
(int)my_id,
|
22
|
-
(int)child_id);
|
23
|
-
printf("pid: %d -- I am waiting for process %d to finish\n",
|
24
|
-
(int)my_id,
|
25
|
-
(int)child_id);
|
26
|
-
wait(&child_status);
|
27
|
-
printf("pid: %d -- my child has completed with status: %d\n",
|
28
|
-
(int)my_id,
|
29
|
-
child_status);
|
30
|
-
} else {
|
31
|
-
my_id = getpid();
|
32
|
-
printf("pid: %d -- I am the child and I am going to count to 10\n",
|
33
|
-
(int)my_id);
|
34
|
-
for(i=0; i < 10; i++) {
|
35
|
-
printf("pid: %d -- %d\n",my_id,i+1);
|
36
|
-
}
|
37
|
-
}
|
38
|
-
|
39
|
-
printf("pid: %d -- I am exiting\n",my_id);
|
40
|
-
exit(0);
|
41
|
-
|
42
|
-
}
|
43
|
-
|
44
|
-
|
data/assets/fork-3.c
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
#include <unistd.h>
|
2
|
-
#include <stdlib.h>
|
3
|
-
#include <stdio.h>
|
4
|
-
#include <string.h>
|
5
|
-
#include <fcntl.h>
|
6
|
-
|
7
|
-
/*
|
8
|
-
* run a program using fork and execve
|
9
|
-
*/
|
10
|
-
int main(int argc, char **argv, char **envp)
|
11
|
-
{
|
12
|
-
pid_t child_id;
|
13
|
-
pid_t my_id;
|
14
|
-
int child_status;
|
15
|
-
int i;
|
16
|
-
char file_name[4096];
|
17
|
-
int err;
|
18
|
-
|
19
|
-
if(argc < 2) {
|
20
|
-
printf("must specify file name as first argument\n");
|
21
|
-
exit(1);
|
22
|
-
}
|
23
|
-
|
24
|
-
memset(file_name,0,sizeof(file_name));
|
25
|
-
strncpy(file_name,argv[1],sizeof(file_name));
|
26
|
-
|
27
|
-
child_id = fork();
|
28
|
-
if(child_id != 0) {
|
29
|
-
my_id = getpid();
|
30
|
-
printf("pid: %d -- I forked pid: %d for: %s\n",
|
31
|
-
my_id,
|
32
|
-
child_id,
|
33
|
-
file_name);
|
34
|
-
wait(&child_status);
|
35
|
-
printf("pid: %d -- %s has completed with status: %d\n",
|
36
|
-
(int)my_id,
|
37
|
-
file_name,
|
38
|
-
child_status);
|
39
|
-
} else {
|
40
|
-
my_id = getpid();
|
41
|
-
printf("pid: %d -- I am the child and I am going to exec %s\n",
|
42
|
-
(int)my_id,
|
43
|
-
file_name);
|
44
|
-
err = execve(file_name,&(argv[1]),envp);
|
45
|
-
/*
|
46
|
-
* not reached if execve is successful
|
47
|
-
*/
|
48
|
-
printf("pid: %d -- execve of %s failed with error %d\n",
|
49
|
-
(int)my_id,
|
50
|
-
file_name,
|
51
|
-
err);
|
52
|
-
|
53
|
-
}
|
54
|
-
|
55
|
-
printf("pid: %d -- I am exiting\n",my_id);
|
56
|
-
exit(0);
|
57
|
-
|
58
|
-
}
|
59
|
-
|
60
|
-
|