The remainder of this chapter is organized as follows. We begin with a discussion of threads, their implementation, and the FreeRTOS API for thread management. We then discuss key synchronization primitives and show how they can be used to control access to shared hardware, shared data (e.g. a FatFS file system) and coordinate scheduling with interrupt handlers (UART receive and send queues).