× 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.



I'm going to ask a n00b question now, but what exactly is multithread 
program?

Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
Tel: 709-576-8132
Email: rpower@xxxxxxxxxx
Website: http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. - 
Sir Winston Churchill




Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
10/08/2004 04:48 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: pThreadCreate() in RPGLE







Hi Srikanth,

> Is it possible to create multithreaded programs in RPGLE, some time back
> I had coded multithreaded programs in C/400 using POSIX APIs (pthread
> APIs).

No, sorry.  Unfortunately, RPG programs cannot be multi-threaded.  The RPG
compiler uses static storage for many of it's internal control structures
in a manner that is not threadsafe.

You can call an RPG program from a multi-threaded application by coding
THREAD(*SERIALIZE) on the H-spec, but it's important to understand what
that does -- it prevents multiple threads from running the RPG code
concurrently...  which usually defeats the purpose of making your
application multi-threaded in the first place ;)


> I now have do the same but in RPGLE, can I get some helpful links or
> reference to sample programs. I checked out QUSRTOOL on my box but in
> vain.

An alternative might be to use more than one job instead of more than one
thread -- in this environment, there's no issue with threadsafety.  You
can use sockets or data queues, etc to synchronize and pass data between
the jobs.

There may be other alternatives as well, depending on what you want to
accomplish with the threads.

Of course, you can always use Java or C to write a multi-threaded
application on the iSeries.  Starting in V5R1, C and RPG are part of the
same package, so if you've got a license to use the RPG compiler, the same
license lets you use the C compiler.   And Java is free, I believe, in
OS/400 -- comes with the operating system.

Good Luck

--
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.




This OutBound email has been scanned for Viruses

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.