基于arm的智能手持设备mp3播放器的设计与开发英文参考文献内容摘要:

concurrently on the system. Although 32,768 might be sufficient for a desktop system, large servers may require many more processes. The lower the value, the sooner the values will wrap around, destroying the useful notion that higher values indicate later run processes than lower values. If the system is willing to break patibility with old applications, the administrator may increase the maximum value via /proc/sys/kernel/pid_max.Inside the kernel, tasks are typically referenced directly by a pointer to their task_struct structure. In fact, most kernel code that deals with processes works directly with struct task_struct. Consequently, it is very useful to be able to quickly look up the process descriptor of the currently executing task, which is done via the current macro. This macro must be separately implemented by each architecture. Some architectures save a pointer to the task_struct structure of the currently running process in a register, allowing for efficient access. Other architectures, such as x86 (which has few registers to waste), make use of the fact that struct thread_info is stored on the kernel stack to calculate the location of thread_info and subsequently the task_struct. On x86, current is calculated by masking out the 13 least significant bits of the stack pointer to obtain the thread_info structure. This is done by the current_thread_info() function. The assembly is shown here:movl $8192, %eaxandl %esp, %eaxThis assumes that the stack size is 8KB. When 4KB stacks are enabled, 4096 is used in lieu of 8192.Finally, current dereferences the task member of thread_info to return the task_struct:current_thread_info()task。 Contrast this approach with that taken by PowerPC (IBM39。 s modern RISCbased microprocessor), which stores the current task_struct in a register. Thus, current on PPC merely returns the value stored in the register r2. PPC can take this approach because, unlike x86, it has plenty of registers. Because accessing the process descriptor is a mon and important job, the PPC kernel developers deem using a register worthy for the task.4 Process StateThe state field of the process descriptor describes the current condition of the process. Each process on the system is in exactly one of five different states. This value is represented by one of five flags:(1) TASK_RUNNING The process is runnable。 it is either currently running or on a runqueue waiting to run. This is the only possible state for a process executing in userspace。 it can also apply to a process in kernelspace that is actively running.(2) TASK_INTERRUPTIBLE. The process is sleeping (that is, it is blocked), waiting for some condition to exist. When this condition exists, the kernel sets the process39。 s state to TASK_RUNNING. The process also awakes prematurely and bees runnable if it receives a signal.(3) TASK_UNINTERRUPTIBLE This state is identical to TASK_INTERRUPTIBLE except that it does not wake up and bee runnable if it receives a signal. This is used in situations where the process must wait without interruption or when the event。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。