Miltu-core CPUs, threads vs AST driven approaches



Say you are writing some internet server that can accept multiple
simultaneous connections.

One can write an AST driven application where the parameter given to the
AST points to a control block that fully describes the connection
context for that remote user. Or, you could go the multi threaded way
where each thread acts independantly and waits for input (while other
threads may be busy).

On a single CPU, there wouldn't be much difference, unless the
processing for each transaction takes long time. For AST driven, nothing
happens until one transaction completes and the next AST kicks in. For
thread driven the pre-emptive multitasking can suspend one thread and
give some CPU to another thread.

Now, when it comes to multi-core CPUs, is it fair to say that the multi
threaded approach will win hands down because it will be able to make
full use of the multiple cores whereas the AST will all be serialised on
one CPU ?


Are there plans for VMS to allow an application to define whether it
wants one serial AST queue (as is the case now) or whether it accepts
ASTs to be delivered concurrently ?

Obviosuly, by default, it would need to have the one serialised queue
because many applications are designed with the expectation of only one
AST ever executing at any point in time. But having the option to allow
multiple concurrent ASTs would be VERY interesting.
.



Relevant Pages

  • Re: Miltu-core CPUs, threads vs AST driven approaches
    ... declaring an application capable of having multiple AST queues that can ... execute on multile CPUs concrrrently. ... multiple AST "processors", its throughput would be much greater. ... make full use of the multi-CPU system. ...
    (comp.os.vms)
  • Re: Miltu-core CPUs, threads vs AST driven approaches
    ... You can have multiple parallel ASTs active across multiple processes, but there can be exactly one AST active per process, at most. ... An AST will interrupt the mainline non-AST processing, and an AST can only be interrupted by an AST arriving in a more privileged access mode. ... If you want to utilize parallel processing (whether SMP or multicore) within the context of a single process, or if you want to allow your application to continue processing while a particular routine is blocked by some wait state on a uniprocessor (or SMP or multicore processor), then you will want to investigate KP threads and at POSIX threads. ...
    (comp.os.vms)
  • Re: Miltu-core CPUs, threads vs AST driven approaches
    ... One can write an AST driven application where the parameter given to the ... On a single CPU, there wouldn't be much difference, unless the ... If correctly written, the current transaction will issue the I/O request asynchronously, exit the AST, and make the single CPU available to service any other pending AST for another transaction. ...
    (comp.os.vms)
  • Re: Miltu-core CPUs, threads vs AST driven approaches
    ... But my suggestion still stands. ... AST is a great dispatcher for tasks. ... delivered on any CPU. ... Because the AST scheduler does not make use of multiple CPUs for the ...
    (comp.os.vms)