zoukankan      html  css  js  c++  java
  • Basic Concepts in OS X Operation System(OSX系统的一些基本概念),准确地说是mach内核的一些基本概念


    Tasks
    A task is a logical representation of an execution environment. Tasks are used
    in order to divide system resources between each running program. Each task
    has its own virtual address space and privilege level. Each task contains one or
    more threads. The tasks address space and resources are shared between each
    of its threads.
    On Mac OS X, new tasks can be created using either the task create() function
    or the fork() BSD syscall.

    Threads
    In Mach, a thread is an independent execution entity. Each thread has its own
    registers and scheduling policies. Each thread has access to all the elements
    within the task it is contained within.
    On Mac OS X, a list of all the threads in a task can be obtained using the
    task threads() function shown below.

    kern_return_t task_threads
        (task_t task,
        thread_act_port_array_t thread_list,
        mach_msg_type_number_t* thread_count);

    The Mach API on Mac OS X provides a variety of functions for dealing with

    threads. Through this API, new threads can easily be created, register contents
    can be modified and retrieved, and so on.

    Msgs
    Messages are used in Mach in order to provide communicate between threads.
    A message is made up of a collection of data objects. Once a message is created
    it is sent to a port for which the invoking task has the appropriate port rights.
    Port rights can be sent between tasks as a message. Messages are queued at the
    destination and processed at the liberty of the receiving thread.
    On Mac OS X, the mach msg() function be used to send and receive messages
    to and from a port. The declaration for this function is shown below.

    mach_msg_return_t mach_msg
      (mach_msg_header_t msg,
      mach_msg_option_t option,
      mach_msg_size_t send_size,
      mach_msg_size_t receive_limit,
      mach_port_t receive_name,
      mach_msg_timeout_t timeout,
      mach_port_t notify);

    Ports
    A port is a kernel controlled communication channel. It provides the ability to
    pass messages between threads. A thread with the appropriate port rights for a
    port is able to send messages to it. Multiple ports which have the appropriate
    port rights are able to send messages to a single port concurrently. However,
    only a single task may receive messages from a single port at any given time.
    Each port has an associated message queue.

    Port Set
    A port set is (unsurprisingly) a collection of Mach ports. Each of the ports in
    a port set use the same queue of messages.

  • 相关阅读:
    如何在Wyn Enterprise中实现数据脱敏
    报表工具中如何在表格实现累计同比
    同一报表,根据不同条件,执行不同Sql
    报表单元格内超过一定长度显示省略号,鼠标悬浮显示全部内容
    报表实现按照天/周/月/季度/年进行快速查询,并且根据快速选择条件进行汇总统计
    典型报表设计:项目应收款统计,行分组不汇总、分组内过滤、行记录和汇总计算
    报表表格实现自定义序号
    报表中常见模糊查询实现
    如何在仪表板表格中将日期显示为文本格式?
    MySQL动态数据源的实现
  • 原文地址:https://www.cnblogs.com/andypeker/p/4056485.html
Copyright © 2011-2022 走看看