Highlighted
Absent Member.
Absent Member.
6529 views

[archive] Multi Threading

[Migrated content. Thread originally posted on 06 October 2005]

Folks,

Do you have any applications written in AcuGT which make use of multi threading.

I.E an initial program, which then calls sub programs independantly of each other using threads?

Or do you achieve this in a similar way somehow?

For example, I want to run my application, and from the menu go to say customer account enquiry and also be in order enquiry at the same time, toggleing between the three?

We do this presently, but I'm just curious if anyone else does something similar as we seem to be encountering serious problems with the runtime(thin client over a unix server)

V6.1 currently, curently testing V7.0

Thanks,

Shaun
0 Likes
19 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

Shaun, We tried doing this with v5.2.1 and found problems too. In the end we ended up allowing users to open multiple sessions of the our app.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

Thanks,

Any chance you could share how you achieve this?

Do you have a menu program and allow users to then pick what they want to do then?

Can they do multiple things at once, e.g. stock enquiry & customer enqury?

Shaun
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

We are trying a different approach.

Although it is not painless, we are writing the process that includes the loader and the menu logic in VB.NET and using the AcuGT automation server (COM) to invoke multiple instances of processes.

AcuGT COM is thread-safe and can be used multiple times (in separate threads). I still can't give you any sample code but this is the basic concept.

I hope this helps.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

We are planning just such an application here. So far in are testing we've not encountered a serious problem. I have even used messaging to prevent duplicate instances of the same program for individual users.

Please advise what sort of problems you are encountering. We are using 6.2/Thin Client/Linux/XP work stations

Regards

Vins Nash
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

We're using threads and messaging aswell.

i.e. we call a program from our menu in a thread

The first thing the called program does is check security issues an decides whether to run or not. If not then it sends a message back to the menu telling it why its not going to run which then informs the user.

All works brilliant, except for 1 specific thing(so far).

For example, menu calls program A, user goes back to menu and calls program B.
Program b (order enquiry) has a grid and the user click on a line on the grid to get details of products on order.
This appears to have a serious impact on the runtime, because at sometime you'll finish looking at the order and want to go back to program A and finish up in there too.

Program A will not terminate, it reaches the EXIT PROGRAM statement and treats it as though it were a CONTINUE statement.
Nett result is that thousands of lines of code are executed, with devastating results to our application in a live customer setup!

Its being fixed by AcuCorp as present, but seems to be a serious weekness of threads. San Diego have been working on the problem for almost 3 weeks now, and we're sort of expecting a fix this week.

Don't get me wrong, but threads are the way to go, its just a pity that we've come across this fault and no one else seems to be using threads unfortunately.
Once they have this fixed we'll get back to business and our customer can calm down

We're using 6.1(fairly heavily patched due to other issues) with openserver 5.0.7 and various windows clients (mostly XP).
The problem exists in 6.1 onwards from what I gather.

Grids seems to be the key here, and if we didn't have any grids, then I don't actually think we would have the problem(but I could be jumping to conclusions here)

Regards,

Shaun
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

Shaun,

One problem may be that "EXIT PROGRAM" is not recognized during an event and with out a "STOP RUN" behind it control will just pass to the next statement and continue executing.

Reference Manual "EXIT STATEMENT" 6.6.

"An EXIT PROGRAM statement has no effect if executed in a program that is the first program of a thread or any program that was not called by another. Neither does it have any effect if it is executed within the scope of an EVENT procedure, unless the return point is also within the scope of the EVENT procedure."

If you are trying to use a mouse click on a grid to select an item and terminate the program returning the selected value to the calling program there is a technique to accomplish that. Send me an email vnash@wescodist.com and I'll send sample code to accomplish that.

Regards

Vins Nash
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

Originally posted by Shaun

Do you have a menu program and allow users to then pick what they want to do then?

Can they do multiple things at once, e.g. stock enquiry & customer enqury?

Shaun


Sorry Shaun I wasn't able to get back to you sooner.

We just allow our users to start login and main menu program again as another session giving them full access to all the options in an application. To switch from one to another users click on the application session on the start bar.

Of course there are record locking issues which we deal with by giving a unique login id per session and use the login id to stamp the record as locked.

We currently use 6.1 and want to be able to do what you are trying to achieve. We tried it in 5.2.1 but could not find an intuitive way to switch from one screen to another especially when the user has many options open. We were trying to emulate MDI technology but could not with AcuGT. How have you managed to solve this?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

We are successfully using different threads using AcuCobol and haven't experienced the same problems you've had. I guess I'll consider myself lucky. 🙂

Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

Hi Rob

Do you mean you have emulated MDI technology using multi-threading? If so can you share with us how you did it?

Shaylesh
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

Originally posted by SRFish
We currently use 6.1 and want to be able to do what you are trying to achieve. We tried it in 5.2.1 but could not find an intuitive way to switch from one screen to another especially when the user has many options open. We were trying to emulate MDI technology but could not with AcuGT. How have you managed to solve this?


We haven't, its just windows open all over the place as you can probably guess.

Shaun
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Multi Threading

Originally posted by Shaun
...windows open all over the place...

was exactly the thing that put us off using it. We found that was confusing for our users. Hopefully Rob might be able to give us a clue if he has managed it. 🙂
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.