ASE 15.7 中的任务(Task)

2009阅读 0评论2012-07-02 lion_sybiq_127
分类:Sybase

   在ASE中,一个任务(Task)是ASE内部的一个可执行程序(execuable)。例如:user connections(client tasks)、daemons(比如,housekeeper tasks)和kernel tasks(比如,I/O handling)。
 在ASE中每个任务都有一个kernel process id ,即KPID。
   ASE调度Tasks到threads(User Task和Service Tasks调度到Engine Threads/Multiplexed Threads,System Tasks调度到RTC Threads)。ASE的tasks包括如下几种:
 
   1. User tasks
     这种任务代表了用户连接(user connections),并且能够执行用户的SQL查询。一个isql连接就是一个user task的例子。
 
   2. Service tasks
     这种任务不会与用户关联,并且不会发出/处理用户查询。Service tasks包括housekeeper tasks、checkpoints、replication agent threads等等。.
 
   3. System tasks
     系统任务是指ASE内核级的service tasks(kernel-level versions of service tasks). System tasks包括I/O handlers、the clock handler、cluster membership service、IP link monitor, and so on.
 
   在ASE中,任务(task,又叫做process)有四种状态:running、runnable、 sleeping和 blocked。当一个任务不是运行状态(running,即在CPU上执行)时,它可能处于如下三种状态之一:
   (1) Waiting on the CPU (the “runnable” state)
   (2) Sleeping because of disk or network I/O
   (3) Blocked on a resource (a lock, semaphore, spinlock,日志满而阻塞等等)
 
   “密切关系(Affinity)”是指特定的ASE 任务(tasks)只能运行在特定的引擎上(这种“密切关系”又叫做task affinity) ,特定的引擎为一个特定的任务(连接)处理network I/O (network I/O affinity),或者特定的引擎只能运行在特定的CPU上(这种“密切关系”又叫做engine affinity)。
   在“process mode”下,一个ASE连接(即client task)与接收(accepted)连接的引擎有“network I/O affinity”(即task affinity),这个引擎必须为该连接做所有network I/O操作。
 
   在“threaded mmode”下,不存在“network I/O affinity”,因为任何引擎可以为任何连接执行network I/O操作,这可以降低上下文切换(context switching)、提高性能。
  
上一篇:ASE 15.7 的内核(Kernel)
下一篇:ASE 15.7 中的线程(Threads)和线程池(Thread Pools)