CIS 260 Other threading topics

  • yield(): allows other threads a chance to run
  • priorities: higher priority threads will be given more time to run than lower priority threads
    • setPriority(): sets a thread's priority
    • getPriority(): gets a thread's priority
  • groups: threads can be organized into groups, which allows operations to be carried out on multiple threads
  • daemons: daemons are threads that run in the background; a program stops when all non-daemon threads have finished running
  • the synchronized modifier is NOT inherited with a method
  • synchronizing is expensive, but often neccessary

Previous: daemon threads