In the C/C++ Programmers Guide under Input and Output there is this note:

"Avoiding Undesirable Results when Using I/O

File serialization is not provided for different tasks attempting to access the 
same file. When a C/C++ application is run on one task, and the same 
application or another C/C++ application is run on a different task, any 
attempts for both applications to access the same file is the responsibility of 
the application."

So the question then becomes whether or not the multiple Java threads are 
running on a single TCB or on multiple TCB's.  Not being a JVM expert I don't 
know the answer to that question.

I'm AssUMing that your "native C library" is a JNI application, so a second 
question would be whether JNI applications are allowed/disallowed from being 
used in multiple threads at the same time.  Which is something a Java guru 
would need to tell you.

I know I'm only asking more questions here, but I suspect that going down those 
roads may lead you to better answers.

HTH

Peter

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Michael Knigge
Sent: Wednesday, June 29, 2016 1:30 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Multithreaded output to stderr and stdout

All,

I have a multithreaded Java application that writes to stdout (and
stderr) thru a native C library using fputc and fwrite. Now, at our site 
everything is all right with output to stderr and stdout from multiple threads.

At a customer site only output from the main thread is written to the "file" if 
the DD STDOUT (or STDERR) points to a MVS Data Set. All output from the other 
threads is discarded.

If the DD points to SYSOUT=* (instead of a MVS Data Set) the output from the 
threads is written to the "file" as expected....

Does anyone have an idea why? LE370 settings are equal to the settings 
at our site...  Maybe a special SMS Setting?? I have no idea (and no 
access to the customer site)....

Thank you,

Michael
--


This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to