• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

preemptive and time slicing for Thread

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all.
I am not sure if BOTH preemptive AND time-slicing can be present on a particular machine. preemptive means if there is a runnable higher priority thread, the current thread will be bumped off while time-slicing means every thread gets its alloted time.
so my real question is: when a thread of higher priority is runnable, does it ALWAYS cause the current thread to yield? even if the machine has a time-slicing mechanism?
please advise! much apprecaited.
chun
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Short answer - No
Exactly how the JVM responds to this situation depends on how the implementor wanted to do it.
Bill
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chun Wang:
Hi Chun Wang.

Yes, BOTH preemptive AND time-slicing can be present on a particular machine. When a High priority thread is present, it preempts the low priority threads. When all threads have same level of priority, the time-slicing mechanism would be used.

Bala Arul


 
reply
    Bookmark Topic Watch Topic
  • New Topic