- 论坛徽章:
- 0
|
读了一部分译作,记录了一些感觉可以进一步推敲的地方,按原文、DarkBlueSea以及我的格式整理。翻译这种事情,很多时候都取决于各人自己的阅读感受,如何才译得合适很难有一个标准。因此,下面这些内容仅供DarkBlueSea参考。
【原文】:
libc_r is entirely invisible to the kernel, and multiplexes threads within a single process.
【DarkBlueSea】:
libc_r是一个内核完全不可见的,并且允许进程拥有多个线程的用户空间线程库。
【雨丝风片】:
libc_r对于内核来说完全不可见,它就在单个进程内部完成多个线程的复用。
【原文】:
relies on the kernel scheduler to multiplex "threads" onto the available processors.
【DarkBlueSea】:
依靠内核调度器,使多个“线程”能在可用的处理器上执行。
【雨丝风片】:
依靠内核调度器在所有可供使用的处理器上复用多个线程。
【原文】:
Both approaches have scaling problems.
【DarkBlueSea】:
两者都存在比例转换问题。
【雨丝风片】:
两种方法都存在扩展性的问题。
【原文】:
and the FreeBSD Project's general reluctance to build substandard solutions to problems.
【DarkBlueSea】:
FreeBSD项目一般不原意用低于标准的解决方案去解决问题
【雨丝风片】:
FreeBSD项目一般不愿意用不够水准的方法去解决问题。
【原文】:
which is now an integral part of GNU libc.
【DarkBlueSea】:
LinuxThreads现在是GNU libc整体的一部分
【雨丝风片】:
LinuxThreads现在已经成为了GNU libc的一个主要组成部分。
【原文】:
Both of these libraries have scalability and performance problems for certain types of threaded programs.
【DarkBlueSea】:
这两个库在一定类型的线程程序上,都存在扩展性和性能问题
【雨丝风片】:
对于某些类型的线程化的程序而言,这两个库都存在扩展性和性能方面的问题。
【原文】:
Threading Architectures
【DarkBlueSea】:
线程结构
【雨丝风片】:
线程架构
【原文】:
In all cases, threading is preemptive.
【DarkBlueSea】:
在所有的情况下,线程是优先的。
【雨丝风片】:
对于所有的情况而言,线程都是可抢占的。
【原文】:
Userland threads are implemented entirely in an application program, with no explicit support from the kernel. In most cases, a threading library is linked in to the application, though it is also possible to hand code user threading within an application.
【DarkBlueSea】:
用户线程全部通过用户应用程序实现,不是由内核来明确支持的。在多数情况下,线程库是连接到应用程序中的,虽然同样可以由应用程序来占有用户线程的代码。
【雨丝风片】:
用户级线程完全是在应用程序内部实现的,并不需要内核提供显式的支持。在大多数情况下都是直接把一个线程库链接到应用程序中的,当然,你也可以在应用程序中自己动手编写用户级线程的代码。
【原文】:
Preemptive schedulin
【DarkBlueSea】:
优先级调度
【雨丝风片】:
抢占式调度
【原文】:
Threads must be periodically preempted
【DarkBlueSea】:
线程必须进行周期性的基于优先级的调度
【雨丝风片】:
线程必须周期性地被抢占
【原文】:
This is done by a combination of a timer signal (SIGALARM for libc_r), which allows the userland threads scheduler (UTS) to run, and setjmp()/ longjmp() calls to switch between threads.
【DarkBlueSea】:
这个已经通过一个组合定时器信号(libc_r的SIGALARM)实现了,它允许用户态线程的调度器(UTS)运行,并且通过setjmp(3)/ longjmp(3) 调用实现在线程间切换。
【雨丝风片】:
这是通过把一个定时器信号(libc_r的SIGALARM)和setjmp()/logjmp()调用结合起来完成的,其中,定时器信号使得用户级线程调度器(UTS)可以运行,而setjmp()/longjmp()调用则用于在线程之间进行切换。
【原文】:
libc_r handles non-blocking and incomplete system calls by converting file descriptors to non-blocking, issuing I/O requests, then adding file descriptors to a central poll()-based event loop.
【DarkBlueSea】:
libc_r通过把文件描述符转换为非阻塞来处理非阻塞和不完全系统调用,放出I/O请求,接着把文件描述符加入到一个基于poll()调用的中央事件循环
【雨丝风片】:
libc_r处理非阻塞的和未完成的系统调用的方法是先把文件描述符转换成非阻塞的,然后发出I/O请求,最后再把文件描述符加到一个核心的基于poll()的事件循环中。
【原文】:
The central poll() loop does not scale well to large numbers of threads. This could probably be solved by converting to the kqueue() interface
【DarkBlueSea】:
中央循环不能很好的衡量大量的线程,这个问题可能通过转变为kqueue(2) 的接口来解决。
【雨丝风片】:
核心的poll()循环在线程数目很大的情况下的扩展性不是很好。不过这或许可以通过改用kqueue()接口来解决。 |
|