• Software
  • Leadership
  • Agile
  • Events
  • Other Topics
    • Finance
    • Robotics & AI
    • System Administration
    • Books
    • Life Experiences
    • Environment
  • Write and Earn
  • About Us
    • About Us
    • Our Contributors
    • Contact Us
    • Article Submission Guidelines
    • Logo demystified
  • Follow @MeJaneve
    Janeve.Me
  • Categories

    Browse through following categories for articles written by professionals.
    • Agile
      4
    • Books
      5
    • Environment
      1
    • Events and Conferences
      7
    • Featured
      15
    • Finance
      1
    • Leadership
      5
    • Life Experiences
      8
    • Robotics & AI
      1
    • Software
      29
    • System Administration
      2
  • Software
  • Leadership
  • Agile
  • Events
  • Other Topics
    • Finance
    • Robotics & AI
    • System Administration
    • Books
    • Life Experiences
    • Environment
  • Write and Earn
  • About Us
    • About Us
    • Our Contributors
    • Contact Us
    • Article Submission Guidelines
    • Logo demystified
Home » Software

Native vs Green threads

Janeve George Posted On February 24, 2012
0
1.9K Views


0
Shares
  • Share On Facebook
  • Tweet It

Understanding a multi-threaded program have always been a wild goose chase for many programmers. There are always many aspects to consider when writing a multi-threaded program.

Native Threads vs Green Threads

The difference between  native threads and green threads is something that new programmers may be unaware of. Both are mechanisms are ways of achieving a “multi-threaded program”. It is the compiler / interpreter variants that usually implements green or native threads.

Native threads uses the operating systems threading capability to execute multi-threaded programs on the other hand, the green threads emulates the multi-threading without using the underlying capabilities of the OS.

Green threads are also known as “Cooperative Threading” where each processes co-operate with each other to emulate a multi-threaded environment.

Execution in a multi-core machines

Another advantage of native threads is that multiple processes would execute in parallel in a multi-core machine. On the other hand, green threads are executed on a single core the entire time and it is the VM that gives a multi-threading notion. So actually there is only singe executing in case of green threads.

Process Scheduling

Native threads uses OS scheduling algorithm. Modern day OSes support pre-emptive scheduling. Green threads can use any kind of scheduling algorithm.

Synchronization and Resource sharing

Native threads usually have complicated synchronization and resource sharing. Multiple processes would require kernel level locks for synchronization. Synchronizations are pretty easier in case of green threads.

Post Views: 1,947
0
Shares
  • Share On Facebook
  • Tweet It




Author

Janeve George

A Technology Leader, Software Engineer, and an Agile Methodologies enthusiast. Currently, working as Manager - Product Development with MediaKind India Pvt. Ltd. (previously Ericsson Media Solutions). He has more than a decade of experience spanning different verticals predominated by hosting, cloud and media delivery technologies.

Trending Now
Toolbox for System Designers
Janeve George March 6, 2020
The Standardized HTTP Client API in Java SE 11
Janeve George March 21, 2020
AspectWerkz – Declaring war on spaghetti code
Read Next

AspectWerkz – Declaring war on spaghetti code

  • Follow @MeJaneve
    Janeve.Me
  • Categories

    Browse through following categories for articles written by professionals.
    • Agile
      4
    • Books
      5
    • Environment
      1
    • Events and Conferences
      7
    • Featured
      15
    • Finance
      1
    • Leadership
      5
    • Life Experiences
      8
    • Robotics & AI
      1
    • Software
      29
    • System Administration
      2

  • Popular Posts

    • Scrum Roles and Responsibilities (41,780)
    • Class.forName() and DriverManager.getConnection() (12,291)
    • Daily Stand-up: What, How, Who and When. (11,366)
    • Which Java collection to use? (11,132)
  • Recent Posts

    • The Java Stream API
    • Functional Interfaces in Java
    • Online Webinar: Students & New Technology - 28th July 2020
    • Modular Programming in Java
  • Keep In Touch

    Follow us on social media to get latest articles on Programming, System Architecture, Agile Development Methodologies, Product and Project Management, Personal Development, BigData, Robotics, Upcoming Events and more...


Copyright © 2020 | Janeve.Me. All rights Reserved.
Press enter/return to begin your search