Yuri Marx · Dec 5, 2020

Is it possible do multithreading tasks and manage it using ObjectScript?

Languages like Java and C++ allows to develop a multi-threaded program with two or more parts that can run concurrently and each part can handle a different task at the same time making optimal use of the available resources specially when your computer has multiple CPUs. Is it possible In ObjectScript? If yes, Where I can get a good sample or application?

Product version: IRIS 2020.4
0 504
Discussion (5)1
Log in or sign up to continue

In principle YES.
SQL does it with parallel processing of queries.
CSP Servers do it by its concept of sessions.
The class compiler does it.
Work Queue Manager supports it.
It is part of IRIS.
ObjectScript itself just has a JOB command to start a process in the background.
how you organize it is up to you.


Just in addition to what Robert wrote,  Mumps has the concept of multithreading for  over 50 years! Long before C++ and Java was born.


and to add to my collegues....

You can create Ensemble productions where Business Services create request messages and send the Asynchronously to one or more Business Processes. If the Pool size on those Business Processes then you will end up with multiple Business Processes Instances simultaneously  processing the request messages in the queue for that Business Process. Likewise, Business Services can have a pool size > 0 and the same paradigm works. Ensemble will evaluate the number of messages in the queue for that Service and if need be it will add more instances of the service to process the queue. The only thing you need to worry about is that when  message is picked up by a service of queue it should be locked so that another instance of the serviv=ce or process won't pick up the same same message.

Apart from that Cache has been optimised over the last 20 years to offer the best transactional processing power of any mainstream database and concepts such as threading in other technologies require extra work by developers to implement whereas in Cache you can take it for granted that all of that low level stuff is intrinsically taken care of for you by the Cache Kernel

Thank you @Nigel Salm !

The buzzword "language"  distracted me.
In IRIS our good old ENSEMBLE was renamed to Interoperability and is there by default.

​​​​​@Heloisa Ramalho you should know it best and could give  a native explanation

Hi Yuri

If you could give me some idea of what you are trying to do I might be able to either find some examples or create an example for you