Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Justification of shared memory way of use

0 Kudos

Hi,

According to SAP, shared memory object is supposed to be changed infrequently, about one time in an hour or even less frequently. SAP says, "You should not use shared memory for different purposes if, for example, this results in many modifying accesses of parallel users, as the current locking concept does not support this."
Can you guys clarify what that means? There is a locking mechanism but it takes an hour to recover after a modification happens? Perhaps the reason is because a process can change an SHM object once it gets a direct access, while some other process following locking logic doesn't know that the first process is changing this object?

THanks!

1 ACCEPTED SOLUTION

custodio_deoliveira
Active Contributor
0 Kudos

Hi Victor,

It (roughly) means that if you will have frequent write operations you should not used shared memory objects otherwise you will have performance issues. If this is your case, you should search for an alternative solution.

Cheers,

Custodio

3 REPLIES 3

custodio_deoliveira
Active Contributor
0 Kudos

Hi Victor,

It (roughly) means that if you will have frequent write operations you should not used shared memory objects otherwise you will have performance issues. If this is your case, you should search for an alternative solution.

Cheers,

Custodio

0 Kudos

Thank you Custodio.

To check that, I wrote two programs. One of them adds one sales order to a table in shared memory and then waits for a second at every iteration. Another one easily reads the latest order about 10-20k times in that second when it's not write locked. Two concurrent read processes read about 1m rows of that table each in less than 5s.

That exercise showed yet another probable reason for that. Write/update lock is exclusive and locks the whole data object. In case of steady stream of overlapping read requests it's going to be hard to find a window in time to update the object, e.g. add a record.

Any other ideas?

THanks

0 Kudos

Hi Victor

you can create an instance methods in a class one to set and other to get the data. The Attribute of the class will be a table with sales orders in your case.