Skip to main content

Posts

Optimizing C programs on z/OS

A few years ago I investigated the performance of our application on z/OS. The application is written in C and runs in batch and CICS. A customer reported that our latest version was not performing as well as the version they were currently running. Testing showed there was a difference. The same tests did not show a difference on other platforms. z/OS has unique characteristics, not surprising given the hardware it runs on, and there are bound to be factors that affect performance that do not affect other platforms. We build our application using unix system services and link the final modules into a Dataset (load library). What this means is that we can use standard unix shell utilities, make files and other tools just like on any other unix platform. This makes development much easier. The final link is the first time anything leaves the unix environment. When investigating anything on z/OS the first place to go for information is the IBM Redbooks site. I found several books d
Recent posts

"No child processes" error

A problem was reported by a customer. They were getting a failure and in the logs it reported error → waitpid failed 'Reason: No child processes' The “No child processes” error came from waitpid() after using  fork/spawn to launch a utility to load data into a data base. Upon detailed investigation it appears it is possible that some other process that the user is running has changed the default handler for SIGCHLD - possibly the shell (e.g. bash!) used to launch our server processes.  If the signal handler is set to SIG_IGN then when a process is started using fork()/exec() the return code from the process is NOT returned and waitpid() cannot retrieve the response code. The most likely reason for "No child processes" error from waitpid() is that the signal handler for child processes (SIGCHLD) is not set to SIG_DFL. This should not be possible however it seems that on Linux a process run in the shell (or maybe a shell process) can set it to SIG_IGN

Investigating Machine learning

Introduction I have been reading articles, one or two books, watching presentations and demonstrations and following online courses on machine learning for the last two years. I have been thinking about how to apply this knowledge to data analysis, search and match for even longer. The lofty goal of machine learning is artificial intelligence - the mimicking of human intelligence. The ability to make a machine appear to be human. When you look at what has been achieved using machine learning - recognizing hand written digits, identifying faces (and kittens) in images, voice recognition - it can seem daunting. However after reading about neural nets, boost algorithms, gradient descent and other algorithms for Machine learning it becomes obvious that what is being done is fitting data to a pattern recognition or decision tree engine. The power comes from building the decision tree or pattern recognition (for a programmer it is similar to a massive set of "if, then, else" sta

Vising another office - What do you need when you arrive?

One of the challenges when traveling is being able to connect and charge all the different devices we take with us. These devices differ depending on the purpose of the trip (business or pleasure) but have the same challenges.When traveling for pleasure you may be staying with relatives, friends or at an AirBnB. What is available may be unknown. Many hotels cater for international travelers and have sockets that allow many different plugs to be used - The JW Marriott in Bangalore allows you to plug in any type of plug (all that I have seen!). One hotel in Sydney had USB charger ports available. The first challenge is being able to plug your charger in. When traveling for work I always carry two adapters that convert from the local plug standard to the plugs required for my devices and chargers. An alternative is to carry one adapter and a power board. The exception to the two adapters is when I am traveling to multiple countries which have different plugs! In those cases

The problem with acronyms

Have you ever attended a presentation and been confused as to what an acronym meant? Have you asked what it meant or did you wait in vain for someone else to ask first? Have you thought you knew what it meant only to realize after a minute or two that you didn't? The problem with not defining the acronyms that you use in a presentation or talk are that a particular acronym means different thing to different people. We all know, or think we know, what certain acronyms mean - SDK means Software Development Kit, JVM is Java Virtual Machine - and some acronyms are so well known that they can be relied upon to always mean the same thing. Does anyone use the acronym IBM to mean anything other than International Business Machines? However many acronyms are reused for different meanings. The other problem is that it can take a few seconds to remember or to work out what the acronym means. That is time you should have been paying more attention to the presenter. When presenting pleas

The Art Of Debugging

My first taste of commercial software development came using Adabas / Natural - a data base with a 3GL programming language. There were no debuggers available but it had an interpreted development environment and you could write code and use print statements to debug your code. I was amazed when I was asked by another developer to help fix a bug in his code and observed that they did not use the same debugging technique. This developers debugging technique was to (apparently randomly) choose a line or two of code, change something, and rerun their application to see if the outcome changed. A couple of print statements quickly narrowed down the problem and had their program working. I found my productivity was many times better just because I had mastered that simple debugging technique. It took me minutes to fix a problem rather than days (or never!). One day I volunteered to port an imap implementation to OS/2. I thought that because it was written for Unix and on my OS/2 developmen