Previous Next        Current Page: NeXtMidas Training / Getting Started - Part 2 / Threads in NeXtMidas / Threads vs Processes
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
   + Advanced Results Parameters   
   + Lab 3   
   - Threads in NeXtMidas   
      - Threads vs Processes   
      - Running in the Background   
      - Registry   
   + Lab 4   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
Macros - Part 2 (Graphics)   
NetBeans - Part 1 (Setup)   
NetBeans - Part 2 (GUIs)   
NetBeans - Part 3 (Profiler)   
Eclipse - Part 1 (Setup)   
Eclipse - Part 2 (GUIs)   
Primitives   
Applets & WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • Threads vs Processes
    Threads
    Wikipedia Definition: "Threads are a way for a program to split itself into two or more simultaneously (or pseudo-simultaneously) running tasks."
    Interaction between threads in an application is comparatively easy.
    Processes
    Wikipedia Definition: "A process is a running instance of a program, including all variables and other state."
    Interaction between different processes is comparatively difficult.
  • Threads and Processes in NeXtMidas
    • An easy way to remember the difference: "A thread is like a worker in a company, and a process is like a company. Workers in a company can perform separate tasks simultaneously, yet they can easily share resources. Different companies can perform separate tasks; however, if two companies want to share resources, it is a lot more difficult.
    • With NeXtMidas there is a single process, the Java Virtual Machine (JVM) which is running the shell.
      • The JVM is started by running nm
    • NeXtMidas has the option of using multiple threads to allow it to do multiple tasks simultaneously (all of which run inside a single JVM).
    • Threads in NeXtMidas can easily interact with one another and share resources.
X-Midas Users Take Note:
In general, everything in X-Midas runs in a single thread per process. When X-Midas wants to perform multiple tasks simultaneously, it starts a new processes for each task. This is why it is comparatively difficult for X-Midas to share resources between different primitives and necessitates the use of "shared memory sections" and Inter-Process Communication (IPC).