problem with vast processes

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

problem with vast processes

Postby Smuglov » Sun Sep 30, 2007 7:39 am

Hi

I have complex application written in different languages. Main part is written on Java. But "simulation" part is written on VAST. This part is started in separate process with help of nodialog.exe file. VAST part have web service that accepts requests from Java. This solution is not acceptable any more because of performance and stability problems.

I am trying to evaluate following solution: VAST is accessed from Java code with help of Smalltalk Call-in support (abtvxt40.dll). Not directly, but through C++ redirector (simple DLL). Using this approach I am faced with following problem: if VAST code spawns some vast process (fork) then those process do nothing after first process is finished. As I understand there is simply no any thread that can execute VAST code and all these vast processes are managed by VAST machine itself (pseudo multithreading?).

What mechanisms are hidden inside nodialog.exe? How they manage spawned processed to be performed even after request to VAST is finished and thread is returned to Java part?

Thanks is advance.

PS. VAST 6.0.3 is used.
Smuglov
 
Posts: 3
Joined: Fri Sep 28, 2007 3:11 am

Re: problem with vast processes

Postby marten » Sun Sep 30, 2007 8:35 am

Smuglov wrote:Hi

I have complex application written in different languages. Main part is written on Java. But "simulation" part is written on VAST. This part is started in separate process with help of nodialog.exe file. VAST part have web service that accepts requests from Java. This solution is not acceptable any more because of performance and stability problems.

I am trying to evaluate following solution: VAST is accessed from Java code with help of Smalltalk Call-in support (abtvxt40.dll). Not directly, but through C++ redirector (simple DLL). Using this approach I am faced with following problem: if VAST code spawns some vast process (fork) then those process do nothing after first process is finished. As I understand there is simply no any thread that can execute VAST code and all these vast processes are managed by VAST machine itself (pseudo multithreading?).

.


Smalltalk code is only executed within ONE native operating system thread or process. You may use asynchronous call-outs (to other C-API, libraries or stuff like this) to get some kind of multitasking.

But I do not understand "then those proesses do nothing after first process is finished" - does that mean "..... until ... the first process is finished" ?

And yes, they are pseudo multithreading ... but that's not bad (as one may guess). Even languages like Erlang seem to use this concept and they scale pretty well.

Marten
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Postby Smuglov » Mon Oct 01, 2007 3:55 am

I have two cases, first one is ok, but second don't work.

VAST runned through nodialog.exe (as separate Windows process) and requests are received by web service:
Java calls VAST method "startCalculations"
that method uses fork command to start new VAST process, and returns from "startCalculations" method.
spawned process makes its own work (spends CPU time, I see this in task manager)
later I can receive results from VAST by another request
all is ok.


VAST runned as DLL:
Java calls "startCalculations" with help of Call-in support
that method uses fork command to start new VAST process, and returns from "startCalculations" method.
spawned process do nothing (takes no CPU time at all)
later I can't receive results because they are simply not ready


the difference between two cases as I understand is that special native operating system thread exists in first case. Thread manages spawned processes to receive CPU time (In second case there is no thread that spends its time inside VAST). I don't know how nodialog.exe starts VAST and that is the problem (I can't use the same behavior).

I simply don't know how to start special thread that will give its time to spawned VAST processes.
Smuglov
 
Posts: 3
Joined: Fri Sep 28, 2007 3:11 am

Postby Smuglov » Wed Oct 03, 2007 6:21 am

Smalltalk code is only executed within ONE native operating system thread or process.


Seems that I have undestand the meaning of this words only now.

so I can't use VAST virtual machine in two native threads at all?
Smuglov
 
Posts: 3
Joined: Fri Sep 28, 2007 3:11 am

Postby marten » Wed Oct 03, 2007 9:28 am

Smuglov wrote:
Smalltalk code is only executed within ONE native operating system thread or process.


Seems that I have undestand the meaning of this words only now.

so I can't use VAST virtual machine in two native threads at all?


No, if this is needed, you may consider the option to start several images and do some kind of load balancing .... by yourself.
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest