Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Rake Task Management Essentials
  • Table Of Contents Toc
Rake Task Management Essentials

Rake Task Management Essentials

By : Andrey Koleshko
5 (4)
close
close
Rake Task Management Essentials

Rake Task Management Essentials

5 (4)
By: Andrey Koleshko

Overview of this book

Table of Contents (18 chapters)
close
close
Rake Task Management Essentials
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
1
Index

Thread safety of multitasks


Rake's internal data structures are thread-safe, so we don't have to do extra synchronization for the benefit of Rake. However, if we have shared variables or resources (for example, the database or files) and the parallel tasks are simultaneously performing operations under them, we must prevent race conditions with additional effort. Basically, this requires using additional tools to synchronize the data.

You've already seen the problem with the @a variable in the previous example. To get rid of the problem, we have to ask the set_b task to wait for the set_a task. However, as we don't have public access to their threads, we can't to do this, so they can't be executed in parallel. In the example, multitasking is redundant and a sequential execution will be more appropriate there; be careful when using multitasking because of this particular reason.

Note

Unfortunately, this book is not intended to explain the multithreading theme and how it works in Ruby. To get...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Rake Task Management Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon