[an error occurred while processing this directive]

HP OpenVMS Systems

ask the wizard
Content starts here

» close window

The Question is:

 
Dear Sir,
    I just wonder that do I still get benefit on
mutithread programming though I have only 1 CPU?
I use Axp 2100 run on VMS 7.1 DEC 5.6.
 
Regards
Seng
 
 


The Answer is :

  Some tasks are made simpler by coding them as multithreaded programs. This
  may be a benefit, regardless of the presence of multiple processors to
  execute the threads in parallel. Where multiple processors exist, such
  programs may execute faster. In a single processor system, a given
  multithreaded program may execute slower than it's single threaded
  homologue because of the overhead of threading context switches. On the
  other hand, the multithreaded version may run faster than singlethreaded,
  even on a single CPU, if it allows computational threads to execute while
  I/O threads are waiting for I/Os to complete.
 
  For some applications, the benefits of multithreaded coding matching the
  structure of the problem at hand, thereby greatly simplifying programming,
  will overwhelm any gains or losses in processing speed.
 
  So, I guess the simple answer is "it depends".
 

answer written or last revised on ( 4-SEP-1998 )

» close window