Lines Matching refs:a

3 In a multi-threaded real-time system, the completion of a task can often be accomplished through co…
13a predetermined order. Thread synchronization refers to multiple threads controlling the execution…
15 …il the resource occupant releases the resource. Thread mutex can be seen as a special kind of thre…
29 ①When the parking lot is empty, the administrator of the parking lot finds that there are a lot of …
31 …t is full, the administrator finds that there is no empty parking space. As a result, cars outside…
39 …emaphore is a light-duty kernel object that can solve the problems of synchronization between thre…
41 …emaphore is shown in the figure below. Each semaphore object has a semaphore value and a thread wa…
47a data structure used by the operating system to manage semaphores, represented by struct rt rt_se…
63 … and acts as a link between various states of the semaphore. Interfaces related to semaphore are s…
69a semaphore, the kernel first creates a semaphore control block, then performs basic initializatio…
77a semaphore object from the object manager and initialize the object, and then initialize the pare…
90 … uses semaphore, they can be removed to release system resources. To delete a semaphore, use the f…
96 When this function is called, the system will delete this semaphore. If there is a thread waiting f…
108 For a static semaphore object, its memory space is allocated by the compiler during compiling and p…
154 … according to the time parameters to either return directly, or suspend for a period of time, or w…
194 For example, when semaphore value is zero and a thread is waiting for this semaphore, releasing the…
206 This is a sample of semaphore usage routine. This routine creates a dynamic semaphore and initializ…
239 rt_kprintf("t1 release a dynamic semaphore.\n");
258 rt_kprintf("t2 take a dynamic semaphore, failed.\n");
265 rt_kprintf("t2 take a dynamic semaphore. number = %d\n" ,number);
273 /* create a dynamic semaphore with an initial value of 0 */
318 msh >t1 release a dynamic semaphore.
319 t2 take a dynamic semaphore. number = 1
320 t1 release a dynamic semaphore.
321 t2 take a dynamic semaphore. number = 2
322 t1 release a dynamic semaphore.
323 t2 take a dynamic semaphore. number = 3
324 t1 release a dynamic semaphore.
325 t2 take a dynamic semaphore. number = 4
326 t1 release a dynamic semaphore.
327 t2 take a dynamic semaphore. number = 5
328 t1 release a dynamic semaphore.
329 t2 take a dynamic semaphore. number = 6
330 t1 release a dynamic semaphore.
331 t2 take a dynamic semaphore. number = 7
332 t1 release a dynamic semaphore.
333 t2 take a dynamic semaphore. number = 8
334 t1 release a dynamic semaphore.
335 t2 take a dynamic semaphore. number = 9
336 t1 release a dynamic semaphore.
337 t2 take a dynamic semaphore. number = 10
340 As the result of the operation above: Thread 1 sends a semaphore when the count is multiple of 10 (…
346a "producer-consumer-warehouse" model. We call the available spots in the warehouse "empty seats",…
355 …sem_lock: This semaphore acts as a lock because both threads operate on the same array array which…
360 … available seat (sem_empty value minus 1), generate a number, loop into the array, and then releas…
372 /* Define a maximum of 5 elements to be generated */
402 rt_kprintf("the producer generates a number: %d\n", array[set % MAXSEM]);
410 /* Pause for a while */
424 /* obtain a "full seat" */
430 rt_kprintf("the consumer[%d] get a number: %d\n", (get % MAXSEM), array[get % MAXSEM]);
440 /* Pause for a while */
505 the producer generates a number: 1
506 the consumer[0] get a number: 1
507 msh >the producer generates a number: 2
508 the producer generates a number: 3
509 the consumer[1] get a number: 2
510 the producer generates a number: 4
511 the producer generates a number: 5
512 the producer generates a number: 6
513 the consumer[2] get a number: 3
514 the producer generates a number: 7
515 the producer generates a number: 8
516 the consumer[3] get a number: 4
517 the producer generates a number: 9
518 the consumer[4] get a number: 5
519 the producer generates a number: 10
521 the consumer[0] get a number: 6
522 the consumer[1] get a number: 7
523 the consumer[2] get a number: 8
524 the consumer[3] get a number: 9
525 the consumer[4] get a number: 10
552 Semaphores is a very flexible way to synchronize and can be used in a variety of situations, like f…
562a single lock is often applied to multiple threads accessing the same shared resource (in other wo…
568 … and confirming the interrupt to clear interrupt source, and then releasing a semaphore to wake up…
578a semaphore is initialized to 5, then the semaphore can be reduced by a maximum of 5 consecutive t…
580 …n a hybrid mode, because there are still multiple accesses from threads for a single resource proc…
584 …s, also known as mutually exclusive semaphores, are a special binary semaphore. Mutex is similar t…
588 The difference between a mutex and a semaphore is that the thread with a mutex has ownership of the…
590a thread holds it, then the mutex is locked and its ownership is obtained by this thread. Converse…
594a high-priority thread attempts to access shared resource through the semaphore mechanism, if the …
598 …e. Priority inheritance refers to raising the priority of a low-priority thread that occupies a ce…
600 ![Priority Inheritance (M is a mutex)](figures/06priority_inherit.png)
606a data structure used by the operating system to manage mutexes, represented by the struct rt rt_m…
626 …ure. The operation of a mutex includes: creating/initiating a mutex, obtaining a mutex, releasing
632 When creating a mutex, the kernel first creates a mutex control block and then completes the initia…
638a mutex whose name is designated by name. When this function is called, the system will first allo…
650 …nger used, the system resource is released by removing the mutex. To remove a mutex, use the follo…
656 When a mutex is deleted, all threads waiting for this mutex will be woken up, return value for the …
668 The memory of a static mutex object is allocated by the compiler during system compilation, and is …
704 …mutex, the thread has ownership of the mutex, that is, a mutex can only be held by one thread at a
725 When a thread completes the access to a mutually exclusive resource, it should release the mutex it…
743 This is a mutex application routine, and a mutex lock is a way to protect shared resources. When a
780 …2 are the same. If they are the same, it means the mutex succeesfully played the role of a lock. */
803 /* Create a dynamic mutex */
854 Another example of a mutex is shown in the following code. This example creates three dynamic threa…
908 …* Trying to hold a mutex lock. At this point, thread 3 has the mutex lock, so the priority level o…
931 rt_kprintf("thread3 take a mutex, failed.\n");
934 /* Operate a long cycle, 500ms */
943 /* Created a mutex lock */
1006 The use of a mutex is relatively simple because it is a type of semaphore and it exists in the form…
1008 (1) When a thread holds a mutex multiple times. This can avoid the problem of deadlock caused by mu…
1014 …le to illustrate event. There may be the following situations when waiting for a bus at a bus stop:
1016 ①P1 is taking a bus to a certain place, only one type of bus can reach the destination. P1 can leav…
1018 ②P1 is taking a bus to a certain place, 3 types of buses can reach the destination. P1 can leave fo…
1020 ③P1 is traveling with P2 to a certain place together, P1 can't leave for the destination unless two…
1022a certain place can be regarded as a thread, and “bus arrives at the bus stop” and “P2 arrives at …
1026a thread and multiple events can be set as follows: any one of the events wakes up the thread, or …
1030 …dependent of each other: each thread can have 32 event flags, recorded with a 32-bit unsigned inte…
1044a data structure used by the operating system to manage events, represented by the structure struc…
1104a static event set object is allocated by the compiler during system compilation, and is usually p…
1146 …ely waiting for the event set objects is used to determine whether there is a thread has the event…
1159 The kernel uses a 32-bit unsigned integer to identify the event set, each bit represents an event, …
1324a variety of situations, and it can replace semaphores to some extent for inter-thread synchroniza…
1328 …vent set contains 32 events, and a particular thread only waits for and receives events it is inte…