Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Coroutine Library in Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

rustcc/coroutine-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Statuscrates.iocrates.io

Coroutine library in Rust

[dependencies]coroutine ="0.8"

Usage

Basic usage of Coroutine

externcrate coroutine;use std::usize;use coroutine::asymmetric::Coroutine;fnmain(){let coro:Coroutine<i32> =Coroutine::spawn(|me,_|{for numin0..10{            me.yield_with(num);}        usize::MAX});for numin coro{println!("{}", num.unwrap());}}

This program will print the following to the console

012345678918446744073709551615

For more detail, please runcargo doc --open.

Goals

  • Basic single threaded coroutine support

  • Asymmetric Coroutines

  • Symmetric Coroutines

  • Thread-safe: can only resume a coroutine in one thread simultaneously

Notes

  • Basically it supports arm, i686, mips, mipsel and x86_64 platforms, but we have only tested in

    • OS X 10.10.*, x86_64, nightly

    • ArchLinux, x86_64, nightly

Thanks

  • The Rust developers (context switch ASM from libgreen)

About

Coroutine Library in Rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors13

Languages


[8]ページ先頭

©2009-2025 Movatter.jp