Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tiancaiamao/task
https://github.com/tiancaiamao/task
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/tiancaiamao/task
- Owner: tiancaiamao
- Created: 2012-08-29T07:41:51.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-04-15T13:16:25.000Z (over 9 years ago)
- Last Synced: 2023-03-27T22:23:21.283Z (over 1 year ago)
- Language: C
- Size: 97.7 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
This is an use-level thread lib.
It's something more like the concept of coroutine which I called task in the code.
tasks works in a cooperate way. A task will keep running until:
1.it calls TaskYield to give up CPU
2.it's blocked by channel or I/OFEATURES:
* unlimited main task's stack size
main task use the system stack while other task's stack are malloced
* channel
channel is an important concept from google's Go language.
Do not communicate by sharing memory; instead, share memory by communicating.
* nonblock I/O
As we all knows, if one use-level thread call the block system call, the whole process block.
But in this implement, the lib provide the nonblock I/O. If one task blocks, the lib switch
to other tasks automally rather than hang the whole proces.NOTE:
During the implemention I get great influence by two source code:
libtask -- http://swtch.com/libtask/
coroutine -- https://github.com/cloudwu/coroutine/LICENSE:
GPL license