摘要
在Windows操作系统扩展过程中,由于自定义调度需要自定义的线程同步,因此需要定制同步机制。经过剖析原有临界区的实现机制,设计实现了自定义临界区。在自定义临界区中,利用内核驱动程序提供调度;用无符号整数原子操作,保证内核对象操作原子性;应用内存映射机制将内核对象地址映射为用户态地址,使得操作可在用户态完成从而提高操作效率。实验结果表明,自定义的临界区可以实现线程同步。
In the process of Windows operating system extended, because using the custom scheduling, it required custom syn- chronization of threads, we need to customize synchronization mechanism. After analyzing the original implementation mechanism of critical section, we design a custom critical section. In the custom critical section design, we provide scheduling by using ker- nel driver development. Atomic operation of unsigned integer is used to guarantee the kernel object atomic operation. Memory mapping mechanism is applied to make kernel object address mapping for the user address, so that the operation can be completed in user mode and raise the operation efficiency. The experimental results show that the custom critical section can achieve the syn- chronization of threads.
出处
《计算机与现代化》
2014年第2期222-225,共4页
Computer and Modernization
关键词
临界区
内存映射
原子操作
优先级
critical section
memory-mapped
atomic operation
priority