Rust daily 20191015 AWS open source project department today decided to publicly sponsor the rust language project


AWS’ Sponsorship of the Rust Project

by David Barsky, Arun Gupta, and Jacob Peddicord | on 14 OCT 2019 |

We’re really excited to announce that AWS is sponsoring the Rust programming language! Rust is designed for writing and maintaining fast, reliable, and efficient code. It has seen considerable uptake since its first stable release four years ago, with companies like Google, Microsoft, and Mozilla all using Rust. Rust has also seen lots of growth in AWS, with services such as Lambda, EC2, and S3 all choosing to use Rust in performance-sensitive components. We’ve even open sourced the Firecracker microVM project!


Rxrust v0.3 update release

After we implemented the security of all operators and visual threads in v0.2, rxrust can now pass tasks across threads through the scheduler. In this way, all user supplied closures must meetSend + Sync + 'static, you never even need to use a scheduler and multithreading.

Now, we have removed the boundariesSyncSendand'static, and added new featuresIntoShared。 In this way, operators can be implemented for local threads and implementedIntoSharedConvert it to a thread safe operator. By default, rxrust always uses a single threaded version for best performance, if it needs to be passed in a threadIntoSharedObject, rxrust is used to convert the local object to a thread safe object.

Before update:

let res = Arc::new(Mutex(0));
let c_res = res.clone();
observable::of(100).subscribe(|v| { *res.lock().unwrap() = *v });

assert_eq!(*res.lock().unwrap(), 100);

After update:

let mut res = 0;
observable::of!(100).subscribe(|v| { res = *v });

assert_eq!(res, 100);

Important changes  remove  RxFn  and  RxValue

  • Operators: remove  Multicast

  • Observable: remove  ObservableOnce

  • observable: observable::from_vec  and  observable::from_range  Integrate functions into macrosobservable::from_iter! .

  • observable: observable::emptyFunction becomes macroobservable::empty! .

  • observable: observable::of  Function becomes macro  observable::of! .

  • observable: observable::from_futureFunction becomes macro  observable::from_future!

  • observable: observable::from_future_with_err The function becomes a macro observable:: from_ future_ with_ err!

  • observable: observable::interval  Function becomes macroobservable::interval!

Details go toGitHubsee

Watt: proc macro (proof of concept) supported by wasm. The compilation time is almost zero

  • Faster compilation。   compiling a macro into wasm in advance can save the time of all downstream users of the macro. They do not have to compile macro logic or its dependencies themselves.

  • Isolation。   watt is 100% secure code with zero dependency. In this environment, when the code is running, the only possible interaction between the macro and the external world is limited to the charge token and the generated token. No matter how much unsafe code the macro itself may contain! Due to a module error in the rust compiler or standard library, macros cannot do anything except shuffle tokens.

  • certainty。   from the perspective of system construction, macros supported by wasm have the following advantages: they can be regarded as purely deterministic functions from input to output. Implicit dependencies (for example, through the file system) do not exist, and the build system is invisible to implicit dependencies or does not consider implicit dependencies.

Details go toGitHubsee

Ways to make Tokio scheduler 10 times faster

The role of the scheduler is to schedule work. An application is decomposed into multiple units of work, which we call tasks. When a task can progress, it is runnable; When blocked on external resources, the task will not run (or idle). Tasks are independent because any number of runnable tasks can be executed at the same time. The scheduler is responsible for executing tasks in the running state until they transition back to the idle state. Executing a task means allocating CPU time (a global resource) to the task.

There are many different approaches to modeling schedulers, each of which has its own advantages and disadvantages.

Tokio’s first job theft scheduler came out in March 2018, which is the first attempt based on many incorrect assumptions of the former.

For more information about Tokio, go toOfficial blogsee


This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

Apache sqoop

Source: dark horse big data 1.png From the standpoint of Apache, data flow can be divided into data import and export: Import: data import. RDBMS—–>Hadoop Export: data export. Hadoop—->RDBMS 1.2 sqoop installation The prerequisite for installing sqoop is that you already have a Java and Hadoop environment. Latest stable version: 1.4.6 Download the sqoop installation […]