-
Notifications
You must be signed in to change notification settings - Fork 10
/
README
72 lines (56 loc) · 2.07 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
1. Introduction
micoro (for MIcro COROutine & MIke's COROtine) is a light weight, high
performance coroutine implementation.
The basic idea of micoro come from the paper "Revisiting Coroutines"
(http://www.inf.puc-rio.br/~roberto/docs/MCC15-04.pdf). As the paper proved,
the "full asymmetric coroutine" model is powerful, easier to use and
expressive power equivalent to other similar models. So micoro is actually
a "full asymmetric coroutine" implemenation with simple API and clear
semantics.
The original motivation of micoro is to implement a light-weight
cooperative multitasking infrastructure for server environment, so simple,
performance and robust (rather than portability) is often the top
considerations across disign and implementation.
some features:
* x86 user space fast context switch
* x86 user level light-weight lock
* thread-safe operations
* stack overflow detection
* robust code with careful design and test
* portable for non-x86 using ucontext
* running activity statistics
2. Requirement
Currently only POSIX systems are supported.
Some tested platform:
Linux-2.6.16 x86_32
Linux-2.6.32 x86_64
Linux-3.2 x86_64 GCC-4.7.1
MacOS-10.7.4 x86_64 LLVM-GCC-4.2.1
FreeBSD-9.0 x86_64 GCC-4.2.1
Cygwin_NT-6.1 i686 GCC-4.5.3
3. Install
3.1 install from tarball
tar -xvf micoro-1.0.tar.gz
cd micoro-1.0
./configure
make
sudo make install
3.2 install from git source
* require GNU autotools & libtool installed
git clone git://github.com/mikewei/micoro.git
cd micoro
autoreconf -i
./configure
make
sudo make install
4. Performance
micoro has much higher performance compared with others
(e.g. GNU Pth, PCL, pthread ...)
* my benchmark with a Linux-3.2 CoreDuo 2.1G PC
context switch performance for 10000 concurrent routines:
GNU Pth - 5,876 switches per second
pthread - 237,318 switches per second
PCL - 879,165 switches per second
micoro - 4,577,256 switches per second
5. Bug report
please email to <bin@vip.qq.com>