GREEN THREADS ,NATIVE THREADS

Discussions

EJB programming & troubleshooting: GREEN THREADS ,NATIVE THREADS

  1. GREEN THREADS ,NATIVE THREADS (2 messages)

    dear friends,
                            i am going to write an multithreaded application using java
    SUN provided the type of thread called green threads,but i am not going
    to use GREEN THREADS due to the disadvantage of not supporting to
     PORTABILITY issue ,so i am going to use
    NATIVE THREADS ,friends please tell me how can i write the code using NATIVE THREADS
    and tell me how to invoke NATIVE THREADS.

    and also i want to know ,how can i verify wheather my application using NATIVE THREADS or GREEN THREADS

    thank's in advance

    rex

    Threaded Messages (2)

  2. GREEN THREADS ,NATIVE THREADS[ Go to top ]

    From what I know, the code that you write does not change whether you use Green threads or Native Threads. Back in the old days of JDK 1.1.8 (and below?) there used to be something called the Java Native Threads Pack. You installed it, and made sure that the environment variable called THREADS_FLAG was set to "native" (as opposed to "green") and off you went.

    Some JDKs, while installing, will preset this environment variable in the wrapper script that launches the VM. In other cases, you may have to set it in your .cshrc or .profile file for it to take effect. There is also the option of launching java and javac with a -native flag (used to be the case with the older JDKs, I'm fairly sure that the new JDKs dont support it by default) or a -green flag.

    Never had a need for doing this on NT4/Win2k, perhaps the default thread type is native.

    Please check the sun site for any documentation that may be relevant.

    Hope that helps...

    Raj
  3. GREEN THREADS ,NATIVE THREADS[ Go to top ]

    raj thk's a lot