The OP
Published on 2019-3-5 02:33
Only look at the author
This post is from Programming Basics
Latest reply
The second question.
Since the queue needs to be universal and compiled into a file or lib file, it cannot be coupled with the API of a certain OS. Otherwise, it may not be used on other OSes and it cannot be used on bare metal without OS.
To solve the second problem, it is not difficult. You can use the design pattern of the decorator mode. The queue structure QueueRecord adds lock and unlock function pointers. When calling Queue_Create, the queue user passes in the lock and unlock API of the specific OS (NULL for bare metal), and then determines whether the function pointer is NULL in the Enqueue interface. If it is not NULL, just call it.
If the locking and unlocking function pointers are well abstracted, the queue can be perfectly universal.
Details
Published on 2020-5-17 16:38
| ||
Personal signature
强者为尊,弱者,死无葬身之地 |
||
This post is from Programming Basics
| ||
Personal signature
强者为尊,弱者,死无葬身之地 |
||
|
This post is from Programming Basics
| ||
Personal signature
强者为尊,弱者,死无葬身之地 |
||
|
This post is from Programming Basics
| ||
Personal signature
强者为尊,弱者,死无葬身之地 |
||
|
This post is from Programming Basics
| ||
Personal signature
强者为尊,弱者,死无葬身之地 |
||
|
6
Published on 2019-3-5 15:16
Only look at the author
| |
Personal signatureIIS7站群大全
|
|
|
This post is from Programming Basics
| ||
Personal signature
强者为尊,弱者,死无葬身之地 |
||
|
8
Published on 2019-3-18 08:21
Only look at the author
This post is from Programming Basics
| ||
|
||
|
This post is from Programming Basics
| ||
Personal signature
强者为尊,弱者,死无葬身之地 |
||
|
10
Published on 2019-3-19 17:35
Only look at the author
This post is from Programming Basics
| ||
|
||
|
11
Published on 2019-3-19 17:47
Only look at the author
This post is from Programming Basics
| ||
|
||
|
12
Published on 2019-3-19 17:53
Only look at the author
This post is from Programming Basics
| ||
|
||
|
13
Published on 2019-3-19 17:59
Only look at the author
This post is from Programming Basics
| ||
|
||
|
GuyGraphics
Currently offline
|
14
Published on 2019-9-28 13:57
Only look at the author
This post is from Programming Basics
| |
|
||
|
15
Published on 2020-4-25 22:31
Only look at the author
This post is from Programming Basics
| ||
|
||
|
This post is from Programming Basics
| ||
Personal signature
强者为尊,弱者,死无葬身之地 |
||
|
17
Published on 2020-5-17 16:38
Only look at the author
This post is from Programming Basics
| ||
|
||
|
This post is from Programming Basics
| ||
Personal signature
强者为尊,弱者,死无葬身之地 |
||
|
曾经的版主且威望大于2000,或对EEWORLD论坛有突出贡献的坛友
EEWorld Datasheet Technical Support
EEWorld
subscription
account
EEWorld
service
account
Automotive
development
circle
About Us Customer Service Contact Information Datasheet Sitemap LatestNews
Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190