Chapter 14. Scripting and System Administration


13.3. Conclusion

As we've seen here, Ruby has so-called green threads (not native threads). These do not benefit from having multiple processors in a machine, but they can still be used for some level of concurrency. Threads can be a useful technique in many circumstances, but they can be somewhat problematic to code and debug. This is particularly true when we use sophisticated synchronization methods to achieve correct results.

Ruby provides classes such as Mutex, Monitor, and ConditionVariable to aid in synchronization. It also provides the built-in Queue and SizedQueue classes, which are thread-safe.

In Chapter 14, "Scripting and System Administration," we move away from a discussion of programming technique in itself to a more task-oriented topic. We'll be discussing the use of Ruby for everyday scripting and system administration tasks.




The Ruby Way(c) Solutions and Techniques in Ruby Programming
The Ruby Way, Second Edition: Solutions and Techniques in Ruby Programming (2nd Edition)
ISBN: 0672328844
EAN: 2147483647
Year: 2004
Pages: 269
Authors: Hal Fulton

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net