⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 Netscape NSPR库源码
💻
字号:
NSPR 2.0 evolution------------------Phase 1- todayCurrently (Oct 10, 1996) NSPR 2.0 has two modes.  Either _PR_NTHREAD is defined, in which case the PR_CreateThread() call always creates a native kernel thread, or _PR_NTHREAD is not defined and PR_CreateThread() always creates user level threads within the single, original process.  This source code is reflected in two directories, nspr20/pr/src/threads/native, and nspr20/pr/src/threads/user.  Although the PR_CreateThread() function hasa paramter to specify the "scope" of a thread, this parameter is not yet used- except on solaris where it uses it to specify bound vs unbound threads.Phase 2 - next weekThe next step is to provide a combination of user and native threads.  Theidea, of course, is to have some small number of native threads and each of those threads be able to run user level threads.  The number of nativethreads created will most likely be proportional to the number of CPUs inthe system.  For this reason, the specific set of native threads which areused to run the user-level threads will be called "CPU" threads.  The user level threads which will be run on the CPU threads are able torun on any of the CPU threads available, and over the course of a user-levelthread's lifetime, it may drift from one CPU thread to another.  All user-level threads will compete for processing time via a single run queue.Creation of a CPU thread will be primarily controlled by NSPR itself or bythe user running a function PR_Concurrency().  The details of PR_Concurrency()have not yet been worked out; but the idea is that the user can specify to NSPR how many CPU threads are desired.In this system, user-level threads are created by using PR_CreateThread() andspecifying the PR_LOCAL_SCOPE option.  LOCAL_SCOPE indicates that the threadwill be under the control of the "local" scheduler.  Creating threads withGLOBAL_SCOPE, on the other hand will create a thread which is under the control of the system's scheduler.  In otherwords, this creates a native threadwhich is not a CPU thread; it runs a single thread task and never has more than one task to run.  LOCAL_SCOPE is much like creating a Solaris unbound thread, while GLOBAL_SCOPE is similar to creating a Solaris bound thread.To implement this architecture, the source code will still maintain the "user"and "native" directories which is has today.  However a third directory "combined" will also exist.  To compile a version of NSPR which only createsnative threads, the user can define _PR_NTHREAD.  For exclusive user-levelthreads, do not define _PR_NTHREAD.  To get the combined threads, define_PR_NTHREAD and _PR_USE_CPUS.Phase 3 - later than next weekThe goal is to eliminate the 3 directories.  Once these three models are inplace, the remaining work will be to eliminate the native and user threaddirectories for all platforms, so that the entire thread model is containedwithin what is today called the "combined" model.  This new and glorioussource code will attempt to make the "combined" model on any platforms whichprovide the necessary underlying native threading, but will also be capable of using exclusive user-level threads on systems which don't havenative threads.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -