forked from acl-dev/acl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement the lib_fiber's performance
- Loading branch information
ubuntu14
committed
Jun 11, 2016
1 parent
92b0dc1
commit 0ec7e95
Showing
51 changed files
with
3,120 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
4) 2016.6.11 | ||
4.1) valgrind: 增加编译开关以防止 valgrind 工具对 swapcontext 跳转的误报 | ||
|
||
3) 2016.6.9 | ||
3.1) performance: fiber_schedule.c,由星形切换改为环形切换,从而提升了上下文件 | ||
切换的效率 --- by [email protected] | ||
|
||
2) 2016.6.5 | ||
2.1) feature: 将 fiber_schedule.c, fiber_io.c 中的全局静态变量调整为线程局部 | ||
变量,为实现多线程化协程做准备 | ||
|
||
1) 2016.6.4 | ||
1.1) 当前的协程支持 hook: read/redv/redv/recvfrom/recvmsg, | ||
write/writev/send/sendto/sendmsg, poll/select/sleep/gethostbyname/gethostbyname_r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef FIBER_IO_INCLUDE_H | ||
#define FIBER_IO_INCLUDE_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void fiber_io_stop(void); | ||
unsigned int fiber_delay(unsigned int milliseconds); | ||
unsigned int fiber_sleep(unsigned int seconds); | ||
|
||
void fiber_set_dns(const char* ip, int port); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef FIBER_SCHEDULE_INCLUDE_H | ||
#define FIBER_SCHEDULE_INCLUDE_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct FIBER FIBER; | ||
|
||
FIBER *fiber_create(void (*fn)(FIBER *, void *), void *arg, size_t size); | ||
int fiber_id(const FIBER *fiber); | ||
int fiber_yield(void); | ||
void fiber_switch(void); | ||
void fiber_schedule(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#ifndef ACL_FIBER_INCLUDE_H | ||
#define ACL_FIBER_INCLUDE_H | ||
|
||
#include "fiber_io.h" | ||
#include "fiber_schedule.h" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Author: | ||
[email protected] | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
all: | ||
@(cd dns; make) | ||
@(cd fiber; make) | ||
@(cd read; make) | ||
@(cd httpd; make) | ||
@(cd httpd2; make) | ||
@(cd client; make) | ||
@(cd server; make) | ||
@(cd sleep; make) | ||
@(cd poll; make) | ||
@(cd redis; make) | ||
@(cd redis_threads; make) | ||
|
||
cl clean: | ||
@(cd dns; make clean) | ||
@(cd fiber; make clean) | ||
@(cd read; make clean) | ||
@(cd httpd; make clean) | ||
@(cd httpd2; make clean) | ||
@(cd client; make clean) | ||
@(cd server; make clean) | ||
@(cd sleep; make clean) | ||
@(cd poll; make clean) | ||
@(cd redis; make clean) | ||
@(cd redis_threads; make clean) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.