Win a copy of Fixing your Scrum this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Native Threading...

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does Java use native threads of the OS?? If not, is there a possible way to tell JVM to use these??? Using native threads of the OS boosts the performance.
Thanx
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All Java threads share the same process space and an exception to this is Native threads. Only some compilers support native threads ( IBM's JDK for AIX is an example ). Using native threads certainly improves performance.
Ajith
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java has built-in multithreading which includes multithreading primitives as part of the language itself. C and C++ do not have built-in multithreading therefore they must make calls to the operating system multithreading primitives to accomplish the same tasks.
Hopefully, this helps.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also pay attention to the behavior of Thread.sleep(int) in your code. If you're running under Solaris, which uses 'native' threads, these threads are cooperative, not preemptive within the JRE. Under NT, you don't need to call sleep(), but under Solaris, you do in order for same-priority threads to get CPU time. If your threads aren't getting enough time, try putting a sleep(1) call in.
 
I will suppress my every urge. But not this shameless plug:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic