Counting Semaphore

14,000,000 Leading Edge Experts on the ideXlab platform

Scan Science and Technology

Contact Leading Edge Experts & Companies

Scan Science and Technology

Contact Leading Edge Experts & Companies

The Experts below are selected from a list of 30 Experts worldwide ranked by ideXlab platform

Edward L. Lamie - One of the best experts on this subject based on the ideXlab platform.

  • Event Notification and Synchronization with Counting Semaphores
    Real-Time Embedded Multithreading Using ThreadX, 2020
    Co-Authors: Edward L. Lamie
    Abstract:

    There are two operations that affect the values of Counting Semaphores—tx_Semaphore_get and tx_Semaphore_put. The get operation decreases the Semaphore by one. Like mutexes, Counting Semaphores are often used for mutual exclusion. One major difference between these objects is that Counting Semaphores do not support ownership, a concept that is central to mutexes. Even so, Counting Semaphores are more versatile; they can also be used for event notification and interthread synchronization. Mutual exclusion pertains to controlling threads' access to certain application areas (typically, critical sections and application resources). When used for mutual exclusion, the “current count” of a Semaphore represents the total number of threads that are allowed access to that Semaphore's associated resource. Counting Semaphores can also be used for event notification, as in a producer-consumer application. In this application, the consumer attempts to get the Counting Semaphore before “consuming” a resource (such as data in a queue); the producer increases the Semaphore count whenever it makes something available. In other words, the producer places instances in the Semaphore and the consumer attempts to take instances from the Semaphore. Such Semaphores usually have an initial value of zero and do not increase until the producer has something ready for the consumer. Applications can create Counting Semaphores either during initialization or during runtime. The initial count of the Semaphore is specified during creation. An application may use an unlimited number of Counting Semaphores.

  • RTOS Building Blocks for System Development
    Real-Time Embedded Multithreading Using ThreadX, 2020
    Co-Authors: Edward L. Lamie
    Abstract:

    This chapter reviews the services and components that are available with ThreadX. Four public resources that a thread can use for various purposes, as well as four types of situations where each can be useful, are discussed. An RTOS provides a variety of services to the developer of real-time embedded systems. These services allow the developer to create, manipulate, and manage system resources and entities in order to facilitate application development. ThreadX uses special primitive data types that map directly to data types of the underlying C compiler. A thread is a semiindependent program segment. Threads within a process share the same memory space, but each thread must have its own stack. Threads are the essential building blocks because they contain most of the application programming logic. When a thread is created, several attributes need to be specified. Every thread must have a Thread Control Block (TCB) that contains system information critical to the internal processing of that thread. Several resources require allocation of memory space when those resources are created. ThreadX provides two memory management techniques: the memory byte pool and the memory block pool. Similarities exist between a mutex and a Counting Semaphore, especially when implementing mutual exclusion. A binary Semaphore has many of the same properties as that of a mutex. Event flags also provide a powerful tool for thread synchronization.

  • Real-Time Embedded Multithreading Using ThreadX
    2019
    Co-Authors: Edward L. Lamie
    Abstract:

    Second Edition Chapter 1 - Embedded and Real-Time Systems Chapter 2 - First Look at a System Using an RTOS Chapter 3 - RTOS Concepts and Definitions Chapter 4 - RTOS Building Blocks for System Development Chapter 5 - The Thread - The Essential Component Chapter 6 - Mutual Exclusion Challenges and Considerations Chapter 7 - Memory Management: Byte Pools and Block Pools Chapter 8 ? Internal System Clock and Application Timers Chapter 9 - Event Notification and Synchronization With Counting Semaphores Chapter 10 - Synchronization of Threads Using Event Flags Groups Chapter 11 - Thread Communication With Message Queues Chapter 12 ? Multicore Processing Chapter 13 ? Case Study: Designing a Multi-Threaded System Appendix A - Memory Block Pool Services Appendix B - Memory Byte Pool Services Appendix C ? Event Flags Group Services Appendix D ? Interrupt Control Service Appendix E ? Mutex Services Appendix F ? Message Queue Services Appendix G ? Counting Semaphore Services Appendix H ? Thread Control Services Appendix I ? Internal System Clock Services Appendix J ? Application Timer Services Index MIPS Version Chapter 1 - Embedded and Real-Time Systems Chapter 2 - First Look at a System Using an RTOS Chapter 3 - RTOS Concepts and Definitions Chapter 4 - RTOS Building Blocks for System Development Chapter 5 - Introduction to the MIPS Microprocessor Chapter 6 - The Thread - The Essential Component Chapter 7 - Mutual Exclusion Challenges and Considerations Chapter 8 - Memory Management: Byte Pools and Block Pools Chapter 9 ? Internal System Clock and Application Timers Chapter 10 - Event Notification and Synchronization With Counting Semaphores Chapter 11 - Synchronization of Threads Using Event Flags Groups Chapter 12 - Thread Communication With Message Queues Chapter 13 ? MIPS Interrupt Handling Chapter 14 - Case Study: Designing a Multi-Threaded System Appendix A - Memory Block Pool Services Appendix B - Memory Byte Pool Services Appendix C ? Event Flags Group Services Appendix D ? Interrupt Control Service Appendix E ? Mutex Services Appendix F ? Message Queue Services Appendix G ? Counting Semaphore Services Appendix H ? Thread Control Services Appendix I ? Internal System Clock Services Appendix J ? Application Timer Services Index

Allen Holub - One of the best experts on this subject based on the ideXlab platform.

  • Condition Variables and Counting Semaphores
    Taming Java Threads, 2020
    Co-Authors: Allen Holub
    Abstract:

    This chapter introduces two more Semaphores and rounds out the set of basic synchronization objects that you’ll need to get real work done. Like the Mutex I presented in Chapter 3, these classes duplicate the abilities of the Java language to some extent, but like the Mutex, I’ve fixed some problems (and added some capabilities) with the Java language implementations. I’ll look at two classes: (1) a condition variable that adds to wait() the ability to not wait when the event you’re waiting for has already taken place, and (2) a Counting Semaphore that lets you control a pool of resources without sucking up machine cycles in polling loops.

Zhao Tian-shi - One of the best experts on this subject based on the ideXlab platform.

  • Research on Communication of Video Supervision System Achieved in Embedded Operating System VxWorks
    Journal of Northern Jiaotong University, 2020
    Co-Authors: Zhao Tian-shi
    Abstract:

    Combining with the application of video supervision system which is implemented in real_time operating system VxWorks, the key technique and corresponding mechanism about communication between devices and data are discussed. The current research is based on FSM(Finite State Machine)in an attempt to solving the frame synchronism of serial communication in real time operating system VxWorks. But the focus in this paper is the application of Counting Semaphore in VxWorks, which can be used in the Producer_Consumer problem to solve the data synchronism in multi process communication. The communication mechanism in this paper can be extended to other communication mechanism besides serial devices in VxWorks.

Bill O. Gallmeister - One of the best experts on this subject based on the ideXlab platform.

  • POSIX.4 : Programming for the Real World
    1995
    Co-Authors: Bill O. Gallmeister
    Abstract:

    Preface. Part 1: Programming for the Real World. Chapter 1: Introduction What's POSIX? Doing More the POSIX Way The POSIX Environment The Applications Are Varied The Problems Are the Same Some Solutions to These Problems What POSIX Does Not Do. Chapter 2: The POSIX Way What POSIX Is Compile-Time Checking Run-Time Checking Headers and Namespace Pollution Who's Got What? Conclusion. Chapter 3: The Basics of Real-Time: Multiple Tasks Doing Everything at Once Running in Cycles Multiple Processes Signals Conclusion Exercises. Chapter 4: Better Coordination: Messages, Shared Memory, and Synchronization Communicating Between Processes POSIX.1 Communication: Pipes and FIFOs System V Message Queues POSIX.4 Message Queues POSIX.4 Shared Memory and File Mapping Synchronizing Multiple Processes Conclusion Exercises. Chapter 5: On Time: Scheduling, Time, and Memory Locking Trying to Make Things Happen On Time Rates and Responses Standard Scheduling Solutions Under UNIX Portable Real-Time Scheduling: the POSIX.4 Scheduling Interfaces Making Things Happen On Time Keeping Your Memory Handy: UNIX and POSIX Memory Locking Brass Tacks Nice but Not Necessary: How to Make the Time Readable Conclusion Exercises. Chapter 6: I/O for the Real World I/O Is Everything I/O in Real-Time Systems UNIX Has a Problem with Real-Time I/O Standard UNIX Facilities for Real-World I/O Achieving Greater Control over File Operations Asynchronous I/O: I/O While You Don't Wait Deterministic I/O Conclusion Exercises. Chapter 7: Performance, or How to Choose an Operating System Performance in Real-Time Systems Measuring the Right Thing Metrics for POSIX Systems Conclusion Exercises. Part 2: Manpages.... Part 3: Solutions to Problems Appendix A: Exercise Code. Chapter 3: The Basics of Real-Time: Multiple Tasks. Chapter 4: Better Coordination: Messages, Memory, and Synchronization. Chapter 5: On Time: Scheduling, Time, and Memory Locking. Chapter 6: I/O for the Real World. Chapter 7: Performance, or How To Choose an Operating System. Bibliography. Index. List of Figures. 1-1 Mandatory and optional parts of POSIX.1 and POSIX.4 1-2 Real-time control loop-one device 1-3 Real-time control loop-multiple devices 1-4 Terminals and server 1-5 Multiple servers 2-1 Cross development 2-2 POSIX conformance checking-basic outline 4-1 Result of simultaneous dequeue by two processes 4-2 mmap is used for mapping differing sorts of objects 4-3 How mmap's arguments refer to the mapped region 4-4 A Counting Semaphore over time 4-5 Mutex and condition variables 5-1 Real-time device monitoring and control 5-2 Race condition when setting an absolute timer by yourself 5-3 Layers of software between you and an errant program 6-1 Normal UNIX disk layout and optimal layout for sequential access 6-2 How AIO proceeds 6-3 Asynchronous I/O error and return status 6-4 Race condition between seek and read/write 6-5 Preventing bad things from happening 7-1 The computer responds 7-2 Layers of an I/O implementation 7-3 Non-contested use of Semaphores 7-4 Two processes (P) signalling each other with Semaphores (S) 7-5 A generic performance measurement 7-6 Responsiveness measurement application 7-7 External measurement of interrupt and task response. List of Tables. 1-1 Status of POSIX standards as of April, 1994 2-1 The Menu for POSIX.1 Functionality 2-2 The Menu for POSIX.4 Functionality 2-3 _POSIX_VERSION Possible Values 2-4 POSIX Feature Limits: Maxima 2-5 POSIX Feature Limits: Minimum Requirements 2-6 sysconf Options 2-7 pathconf and fpathconf Options 2-8 POSIX Reserved Namespaces 3-1 Signals Required by POSIX (Default Action Termination) 3-2 POSIX Optional Signals 4-1 Coordination Mechanisms 4-2 How to Get Various Shared Memory and File Mapping Facilities 5-1 Example rate-monotonic priority ssignments

William E. Taylor - One of the best experts on this subject based on the ideXlab platform.