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



From the Multithreaded Applications manual:

A function is threadsafe if you can start it simultaneously in multiple threads within the same process. A
function is threadsafe if and only if all the functions it calls are threadsafe also.

Then it goes on to say what this involves. E.g.,

When writing a threaded application, its important to understand the visibility and scope of various classes
of storage. When your application declares variables, multiple threads might be able to access or use
them. The visibility and scope of the storage it uses often affect your application.

The things that you mention are just some of the resources that may be involved. All threads in a job (process) have access to certain resources that are set at the job level. These include heap, static, and global storage, open files, locales, CCSID, and environment variables.


An important issue is data integrity - if different threads have access to the same open files, any of them can change the data unexpectedly. Or cursor locations in a PF can be altered, so that when you come back, your next read gives the wrong result.

The mutexes, etc., are there to manage resources, so that only one thread at a time can alter them. They are like low-level locks
This manual is a must for understanding how this works on
At 08:38 AM 7/21/2004, you wrote:



What is threadsafe?

Well speaking as a developer who knows next to nothing about this topic let
me try and answer.

With the advent of PASE and other ported Unix applications (note:  Domino)
threads have abounded.  Threads and stuff like mutex's and
semaphores.  There is an optional part of iSeries Navigator called
Application Development.  This will show you these strange things in
memory.

A thread can be spawned by a job.  The job can end and the thread continue
to run.  The next job can start up and have a conflict.  Hence the reason
that Application Development had this part.  (There is a green screen way
of looking at it that a bunch of propeller heads at IBM favor that even a
dyed in the wool SEU person would gag at.)  Some 'early' versions of Domino
spawned some of these and short of using one of the tools to clear them you
had to IPL.  The later versions Domino seem to have been pretty much beaten
into submission.

Therefore a command that is not threadsafe is not recommended to be started
from within one of these threads.  And I've guessed enough on this, so
coming up with a hypothesis as to why any particular command may not be
threadsafe would really be stretching it.

To those in the know, is this a pretty good summary?

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com




-- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-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.