Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - implement semaphore
Search - implement semaphore - List
Purpose Aim to setup a small system above the OS layer , implement the message queue of process or thread and simulate the function of watchdog used to detect the deadlock of the system. - introduction 1. Purpose Aim to setup a small system above the OS layer , implement the message queue of process or thread and simulate the function of watchdog used to detect the deadlock of the system. 2. Method Using window API to create serval thread and create a message queue for each thread to control the message exchange between the different treads. 3. Files Projectmain.h------ structs , enums ,and claim of functions ThreadSemaphore.c------- extend the Windows semaphore API ThreadQueue.c------- message queue file (send to, receive from ,create and destroy queue ) ThreadFrame.c-- 1) create all the task for test 2) control the message handling 3) control the thread running 4)functions of watchdog 5) a hardware timer simulator to create timeout message every 1 sec 4 task : Thread_IDLE,-- lowest prority , interact with user and obtain a semaphore which will be waitted by Thread_LOST later
Date : 2025-12-14 Size : 979kb User : Xiwen

实现一个进程,该进程拥有一个生产者线程和一个消费者线程,它们使用32个不同的缓冲区。使用如下信号量: (1)一个互斥信号量,用以阻止生产者线程和消费者线程同时操作缓冲区列表; (2)一个信号量,当生产者线程生产出一个物品时可以用它向消费者线程发出信号; -Implement a process that has a producer thread and a consumer thread, they use 32 different buffers. Semaphore using the following: (1) a mutex to prevent the producer and consumer threads simultaneously thread the buffer list (2) a semaphore, when the producer thread to produce an item can use it to consumers to signal the thread
Date : 2025-12-14 Size : 2kb User : Andy

使用Windows信号量和互斥量实现生产者和消费者问题。对于多线程开发很有指导意义。-use Windowss semaphore and mutex to implement producer and consumer program!!
Date : 2025-12-14 Size : 33.58mb User :
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.