Reader small image

You're reading from  Network Programming with Rust

Product typeBook
Published inFeb 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781788624893
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Abhishek Chanda
Abhishek Chanda
author image
Abhishek Chanda

Abhishek Chanda studied computer science at IIEST Shibpur in India and electrical engineering at Rutgers University. He has been working on networking and distributed systems since 2008. Over his career, he has worked with large companies (like Microsoft and Dell) and small startups (Cloudscaling, DataSine) in India, US, and the UK. He is enthusiastic about open source software and has contributed to a number of projects like OpenStack, Nomad etc. He contributes to a number of open source projects. He came across Rust in 2015 and found it to be a perfect fit for writing highly performant systems.
Read more about Abhishek Chanda

Right arrow

Data parallelism

Data parallelism is a way of speeding up computation by making data a central entity. This is in contrast to the coroutine and thread-based parallelism that we have seen so far. In those cases, we first determine tasks that can be run independently. We then distribute available data to those tasks as needed. This approach is often called task parallelism. Our topic of discussion in this section is data parallelism. In this case, we need to figure out what parts of the input data can be used independently; then multiple tasks can be assigned to individual parts. This also conforms to the divide and conquer approach, one strong example being mergesort.

The Rust ecosystem has a library called Rayon that provides simple APIs for writing data parallel code. Let's look at a simple example of using Rayon for a binary search on a given slice. We start with setting...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Network Programming with Rust
Published in: Feb 2018Publisher: PacktISBN-13: 9781788624893

Author (1)

author image
Abhishek Chanda

Abhishek Chanda studied computer science at IIEST Shibpur in India and electrical engineering at Rutgers University. He has been working on networking and distributed systems since 2008. Over his career, he has worked with large companies (like Microsoft and Dell) and small startups (Cloudscaling, DataSine) in India, US, and the UK. He is enthusiastic about open source software and has contributed to a number of projects like OpenStack, Nomad etc. He contributes to a number of open source projects. He came across Rust in 2015 and found it to be a perfect fit for writing highly performant systems.
Read more about Abhishek Chanda