• Complain

Mara Bos - Rust Atomics and Locks

Here you can read online Mara Bos - Rust Atomics and Locks full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2022, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Mara Bos Rust Atomics and Locks
  • Book:
    Rust Atomics and Locks
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2022
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

Rust Atomics and Locks: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Rust Atomics and Locks" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

In this practical book, Mara Bos, leader of the Rust library team, helps Rust programmers of all levels gain a clear understanding of low-level concurrency. Youll learn everything about atomics and memory ordering and how theyre combined with basic operating system APIs to build common primitives like mutexes and condition variables. Once youre done, youll have a firm grasp of how Rusts memory model, the processor, and the roles of the operating system all fit together.With this guide, youll learnHow Rusts type system works exceptionally well for programming concurrency correctlyAll about mutexes, condition variables, atomics, and memory orderingWhat happens in practice with atomic operations on Intel and ARM processorsHow locks are implemented with support from the operating systemHow to write correct code that includes concurrency, atomics, and locks

Mara Bos: author's other books


Who wrote Rust Atomics and Locks? Find out the surname, the name of the author of the book and a list of all author's works by series.

Rust Atomics and Locks — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Rust Atomics and Locks" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Rust Atomics and Locks by Mara Bos Copyright 2023 Mara Bos All rights - photo 1
Rust Atomics and Locks

by Mara Bos

Copyright 2023 Mara Bos. All rights reserved.

Printed in the United States of America.

Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.

OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (https://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .

  • Acquisitions Editor: Brian Guerin
  • Development Editor: Shira Evans
  • Production Editor: Elizabeth Faerm
  • Copyeditor: Liz Wheeler
  • Proofreader: Penelope Perkins
  • Indexer: Ellen Troutman-Zaig
  • Interior Designer: David Futato
  • Cover Designer: Karen Montgomery
  • Illustrator: Kate Dullea
  • December 2022: First Edition
Revision History for the Early Release
  • 2022-04-13: First Release
  • 2022-06-23: Second Release
  • 2022-08-09: Third Release
  • 2022-10-20: Final Release

See https://oreilly.com/catalog/errata.csp?isbn=9781098119447 for release details.

The OReilly logo is a registered trademark of OReilly Media, Inc. Rust Atomics and Locks, the cover image, and related trade dress are trademarks of OReilly Media, Inc.

The views expressed in this work are those of the author, and do not represent the publishers views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.

978-1-098-11938-6

[LSI]

To all the Rust contributors that were waiting for me to
review their code while I was busy writing this book.

And to my loved ones, too, of course.

In loving memory of

Amlia Ada Louise, 19942021

Foreword

This book provides an excellent overview of low-level concurrency in the Rust language, including threads, locks, reference counts, atomics, mailboxes/channels, and much else besides. It digs into issues with CPUs and operating systems, the latter summarizing challenges inherent in making concurrent code work correctly on Linux, macOS, and Windows. I was particularly happy to see that Mara illustrates these topics with working Rust code. It wraps up by discussing semaphores, lock-free linked lists, queued locks, sequence locks, and even RCU.

So what does this book offer someone like myself, who has been slinging C code for almost 40 years, most recently in the nether depths of the Linux kernel?

I first learned of Rust from any number of enthusiasts and Linux-related conferences. Nevertheless, I was happily minding my own business until I was called out by name in a Rust-related LWN article, Using Rust for Kernel Development.Thus prodded, I wrote a blog series entitled So You Want to Rust the Linux Kernel?. This blog series sparked a number of spirited discussions, a few of which are visible in the seriess comments.

In one such discussion, a long-time Linux-kernel developer who has also written a lot of Rust code told me that when writing concurrent code in Rust, you should write it the way Rust wants you to. I have since learned that although this is great advice, it leaves open the question of exactly what Rust wants. This book gives excellent answers to this question, and is thus valuable both to Rust developers wishing to learn concurrency and to developers of concurrent code in other languages who would like to learn how best to do so in Rust.

I of course fall into this latter category. However, I must confess that many of the spirited discussions about Rust concurrency remind me of my parents and grandparents long-ago complaints about the inconvenient safety features that were being added to power tools such as saws and drills. Some of those safety features are now ubiquitous, but hammers, chisels, and chainsaws have not changed all that much. It was not at all easy to work out which mechanical safety features would stand the test of time, so I recommend approaching software safety features with an attitude of profound humility. And please understand that I am addressing the proponents of such features as well as their detractors.

Which brings us to another group of potential readers, the Rust skeptics. While I do believe that most Rust skeptics are doing the community a valuable service by pointing out opportunities for improvement, all but the most Rust-savvy of skeptics would benefit from reading this book. If nothing else, doing so would enable them to provide sharper and better-targeted criticisms.

Then there are those dyed-in-the-wool non-Rust developers who would prefer to implement Rusts concurrency-related safety mechanisms in their own favorite language. This book will give them a deeper understanding of the Rust mechanisms that they would like to replicate, or, better yet, improve upon.

Finally, any number of Linux-kernel developers are noting the progress that Rust is making toward being included in the Linux kernel. Next Steps for Rust in the Kernel. As of October 2022, this is still an experiment, but one that is being taken increasingly seriously. In fact, seriously enough that Linus Torvalds has accepted the first bits of Rust-language support into Version 6.1 of the Linux kernel.

Whether you are reading this book to expand your Rust repertoire to include concurrency, to expand your concurrency repertoire to include Rust, to improve your existing non-Rust environment, or just to look at concurrency from a different viewpoint, I wish you the very best on your journey!

Paul E. McKenney

Meta Platforms Kernel Team

Meta

October 2022

Preface

Rust has played, and keeps playing, a significant role in making systems programming more accessible.However, low-level concurrency topics such as atomics and memory orderingare still often thought of as somewhat mystical topics that are best left to avery small group of experts.

While working on Rust-based real-time control systems and the Rust standard library over the past few years,I found that many of the available resources on atomics and related topics onlycover a small part of the information I was looking for.Many resources focus entirely on C and C++,which can make it hard to form the connection withRusts concept of (memory and thread) safety and type system.The resources that cover the details of the abstract theory, like C++s memory model,often only vaguely explain how it relates to actual hardware, if at all.There are many resources that cover every detail of the actual hardware,such as processor instructions and cache coherency,but forming a holistic understanding often requires collecting bits and piecesof information from many different places.

This book is an attempt to put relevant information in one place, connecting it all together,providing everything you need to build your own correct, safe, and ergonomic concurrency primitives,while understanding enough about the underlying hardware and the role of the operating systemto be able to make design decisions and basic optimization trade-offs.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Rust Atomics and Locks»

Look at similar books to Rust Atomics and Locks. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Rust Atomics and Locks»

Discussion, reviews of the book Rust Atomics and Locks and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.