{"id":20949775,"url":"https://github.com/heiher/hev-task-system","last_synced_at":"2025-04-06T12:10:57.015Z","repository":{"id":48147890,"uuid":"82035017","full_name":"heiher/hev-task-system","owner":"heiher","description":"A simple, lightweight multi-task system (coroutines)","archived":false,"fork":false,"pushed_at":"2025-02-28T10:50:14.000Z","size":552,"stargazers_count":81,"open_issues_count":1,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T04:58:09.674Z","etag":null,"topics":["android","c","completely-fair-scheduler","coroutine","epoll","freebsd","io","kqueue","linux","macos","network","windows"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heiher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-15T07:59:12.000Z","updated_at":"2025-03-28T17:38:03.000Z","dependencies_parsed_at":"2024-01-01T04:48:26.748Z","dependency_job_id":"e2f351a0-b92a-4629-a868-0f2c4c66d42d","html_url":"https://github.com/heiher/hev-task-system","commit_stats":null,"previous_names":[],"tags_count":110,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiher%2Fhev-task-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiher%2Fhev-task-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiher%2Fhev-task-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiher%2Fhev-task-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heiher","download_url":"https://codeload.github.com/heiher/hev-task-system/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478324,"owners_count":20945266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","c","completely-fair-scheduler","coroutine","epoll","freebsd","io","kqueue","linux","macos","network","windows"],"created_at":"2024-11-19T00:42:27.695Z","updated_at":"2025-04-06T12:10:56.997Z","avatar_url":"https://github.com/heiher.png","language":"C","readme":"# HevTaskSystem\n\n[![status](https://github.com/heiher/hev-task-system/actions/workflows/build.yaml/badge.svg?branch=master\u0026event=push)](https://github.com/heiher/hev-task-system)\n\nHevTaskSystem is a simple, lightweight multi-task system (coroutines).\n\nThe task system is executed within a native process/thread. In task system, you\ncan create many tasks and attach them to the task system. When a task yields or\nis blocked by I/O, the scheduler will pick a suitable task from running list and\nswitch to it. Memory space, file descriptors, and other resources are shared among\nall tasks in the task system. Each task has its private, standalone task structure\n(#HevTask) and stack in heap of the process.\n\nWithin a task, you can allocate memory from heap, read and write data to the stack,\nand perform I/O operations in synchronized mode.\n\n## Features\n\n* Simple/lightweight task.\n* I/O operations wrapper.\n* Inter-task synchronous. (Mutex/Condition)\n* Inter-task communications. (Channel)\n* Slice-based memory allocator.\n* Call on new stack.\n* Multi-thread support.\n* Multi-platform support. (Linux/BSD/macOS/Windows)\n\n## How to Build\n\n### Unix\n\n```bash\ngit clone https://gitlab.com/hev/hev-task-system\ncd hev-task-system\nmake\n\n# Link with librt (only for glibc versions before 2.17)\nmake LDFLAGS=-lrt\n\n# Disable stack overflow detection\nmake ENABLE_STACK_OVERFLOW_DETECTION=0\n\n# Set stack backend to heap (Recommended for 32-bit)\nmake CONFIG_STACK_BACKEND=STACK_HEAP\n\n# Disable sliced memory allocator\nmake ENABLE_MEMALLOC_SLICE=0\n\n# Disable I/O splice by splice syscall (for old Linux kernel)\nmake ENABLE_IO_SPLICE_SYSCALL=0\n\n# Demos\nmake apps\n\n# Tests\nmake tests\n```\n\n### Android\n\n```bash\nmkdir hev-task-system\ncd hev-task-system\ngit clone https://gitlab.com/hev/hev-task-system jni\nndk-build\n```\n\n### iOS and MacOS\n\n```bash\ngit clone https://gitlab.com/hev/hev-task-system\ncd hev-task-system\n# will generate HevTaskSystem.xcframework\n./build-apple.sh\n```\n\n### Windows (MSYS2)\n\n```bash\nexport MSYS=winsymlinks:native\ngit clone https://gitlab.com/hev/hev-task-system\ncd hev-task-system\nmake LFLAGS=\"-lmsys-2.0 -lws2_32\"\n```\n\n## Demos\n\n1. [simple](https://gitlab.com/hev/hev-task-system/blob/master/apps/simple.c)\n1. [channel](https://gitlab.com/hev/hev-task-system/blob/master/apps/channel.c)\n1. [timeout](https://gitlab.com/hev/hev-task-system/blob/master/apps/timeout.c)\n1. [wakeup](https://gitlab.com/hev/hev-task-system/blob/master/apps/wakeup.c)\n1. [echo-server](https://gitlab.com/hev/hev-task-system/blob/master/apps/echo-server.c)\n1. [call](https://gitlab.com/hev/hev-task-system/blob/master/apps/call.c)\n1. [gtk](https://gitlab.com/hev/hev-task-system/blob/master/apps/gtk.c)\n1. [curl](https://gitlab.com/hev/hev-task-system/blob/master/apps/curl.c)\n\n## Contributors\n\n* **hev** - https://hev.cc\n* **Mike Wang** - https://github.com/MikeWang000000\n\n## License\n\nMIT\n\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiher%2Fhev-task-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheiher%2Fhev-task-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiher%2Fhev-task-system/lists"}