× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



everything scott says in right on target. I would add that there is a way to
syncronize access to a user space amoung multiple jobs.

http://publib.boulder.ibm.com/iseries/v5r1/ic2924/tstudio/tech_ref/mi/LOCKSL
.htm

LOCKSL ( lock space location ) accepts a pointer to a space location and
effectively locks it from use by other jobs that also use LOCKSL before
accessing the space location.

-Steve


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Scott Klement
Sent: Thursday, February 12, 2004 12:29 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: User space



On Thu, 12 Feb 2004, Raul A Jager wrote:
>
> I need to share data between users.
>
> Can I use an "USER SPACE"?

Sure.


> Will the system allow several users updating it?

Yes, but IMHO, not gracefully.

>  when will the upates be seen by others?

As soon as they check for the updates.


A user space is similar to a file, except for three things:

a) It does not have any particular structure.

b) Since there are no records, there's no record locks, etc.

c) It's directly addressable with a pointer from an HLL program.
   (Technically, you can do that with any file, but you need to use MI
    tricks rather than normal HLL operations with non-userspaces)

The big problem is making sure that two jobs don't conflict with one
another.  You have to be very careful about any situation that could lead
to two processes writing data to it at the same time.

I recommend having the jobs communicate with each other using data queues
so that they can synchronize their operations -- preventing them from
conflicting with one another.

But, since they can send data to one another via the data queues, the
question becomes, do you still need the user space?   The only reason I
can think of why you'd want to use a user space for something like this
would be if the data that needs to be accessed is very large.  With a user
space they are sharing a common piece of information, but with data queues
the info is copied from one to the other -- so for very large pieces of
information, user spaces would be quicker.

Hope that makes sense...
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.