Reader small image

You're reading from  Leap Motion Development Essentials

Product typeBook
Published inOct 2013
PublisherPackt
ISBN-139781849697729
Edition1st Edition
Right arrow
Author (1)
Mischa Spiegelmock
Mischa Spiegelmock
author image
Mischa Spiegelmock

Mischa Spiegelmock is an accomplished software engineer from the San Francisco Bay Area. Slightly infamous from light-hearted technical pranks from his youth, he is now a respectable CTO at a healthcare software startup. His passions are architecting elegant and useful programs and sharing his insights into software design with others in a straightforward and entertaining fashion.
Read more about Mischa Spiegelmock

Right arrow

Multiprocessing with threads


The solution to our conundrum is to run more than one thread of execution at the same time. CPUs and modern operating systems are very good at dealing with multiple processes and multiple threads of execution within processes, and this suits our purposes nicely. What we really want is one task that is receiving callbacks from the controller and handling the input, with a separate task taking our control messages and outputting them. This would give us a robust setup in which we can easily do anything we want in the output thread, without introducing issues associated with blocking the input processing thread. We could be happily logging output to a file, sending it over a network, outputting MIDI to hardware, controlling GPIO pins, doing expensive calculations or 3D graphics, and not affect the response time of our Leap callbacks.

As with many things in software development, there is more than one way to achieve our desired result of multitasking: POSIX threading...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Leap Motion Development Essentials
Published in: Oct 2013Publisher: PacktISBN-13: 9781849697729

Author (1)

author image
Mischa Spiegelmock

Mischa Spiegelmock is an accomplished software engineer from the San Francisco Bay Area. Slightly infamous from light-hearted technical pranks from his youth, he is now a respectable CTO at a healthcare software startup. His passions are architecting elegant and useful programs and sharing his insights into software design with others in a straightforward and entertaining fashion.
Read more about Mischa Spiegelmock