大概知道了一些:
现在java线程和操作系统线程之间的对应关系有三种:
多对一、一对一、多对多
                                                                                
多对一就是所说的“Green thread”,一个java应用程序
被当作一个任务被操作系统调度,而这个java应用程序里
的多个线程则由虚拟机调度执行。也可以说由虚拟机选出
一个多线程java程序里的一个线程作为活动线程,这个线
程再作为操作系统的一个任务被操作系统调度。
                                                                                
一对一就是一个java线程对应一个操作系统线程了,即同
一个多线程java程序里的所有线程都由操作系统统一调度。
                                                                                
多对多还不是很明白
                                                                                
至于各种模型的优劣,应该也和具体的操作系统相关吧。欢迎大家讨论  :)

解决方案 »

  1.   

    跪求大家,帮我看看这个问题,谢谢!!!!!!!!!!!!!http://expert.csdn.net/Expert/topic/2633/2633574.xml?temp=.6377375
      

  2.   

    To ManFirst: 偶知道守护进程~但似乎和这个主题没什么主要关系。。
      

  3.   

    用户及线程的调度算法和调度过程全部由用户自行选择和确定,与操作系统内核无关。
    对JVM的调度器和调度没有了解~看来,搂主对操作线程挺熟悉。据个例子先?
      

  4.   

    to dllsf:偶不知道你讲的操作系统是否就是特定的比如win98之类的操作系统~
    也有操作系统是会调度线程的(kernel thread)。下面转载一篇文章,原文还有几副图,
    有兴趣可以到这里去看看:
    http://docs.sun.com/db/doc/805-4031/6j3qv1oej?a=viewfrom docs.sun.com:
    Multithreading ModelsMost multithreading models fall into one of the following categories of threading implementation:    *      Many-to-One
        *      One-to-One
        *      Many-to-ManyMany-to-One Model (Green Threads)Implementations of the many-to-one model (many user threads to one kernel thread) allow the application to create any number of threads that can execute concurrently. In a many-to-one (user-level threads) implementation, all threads activity is restricted to user space. Additionally, only one thread at a time can access the kernel, so only one schedulable entity is known to the operating system. As a result, this multithreading model provides limited concurrency and does not exploit multiprocessors. The initial implementation of Java threads on the Solaris system was many-to-one. One-to-One ModelThe one-to-one model (one user thread to one kernel thread) is among the earliest implementations of true multithreading. In this implementation, each user-level thread created by the application is known to the kernel, and all threads can access the kernel at the same time. The main problem with this model is that it places a restriction on you to be careful and frugal with threads, as each additional thread adds more "weight" to the process. Consequently, many implementations of this model, such as Windows NT and the OS/2 threads package, limit the number of threads supported on the system.Many-to-Many Model (Java on Solaris --Native Threads)The many-to-many model (many user-level threads to many kernel-level threads) avoids many of the limitations of the one-to-one model, while extending multithreading capabilities even further. The many-to-many model, also called the two-level model, minimizes programming effort while reducing the cost and weight of each thread.In the many-to-many model, a program can have as many threads as are appropriate without making the process too heavy or burdensome. In this model, a user-level threads library provides sophisticated scheduling of user-level threads above kernel threads. The kernel needs to manage only the threads that are currently active. A many-to-many implementation at the user level reduces programming effort as it lifts restrictions on the number of threads that can be effectively used in an application.A many-to-many multithreading implementation thus provides a standard interface, a simpler programming model, and optimal performance for each process. The Java on Solaris operating environment is the first many-to-many commercial implementation of Java on an MT operating system.
      

  5.   

    就上面的多对一模式,线程由JVM进行调度;
    而一对一模式,线程调度全部由操作系统完成;
    多对多模式则是需要JVM和操作系统共同完成。