Skip to Main Content
IBM Z Hardware and Operating Systems Ideas Portal


This is the public portal for all IBM Z Hardware and Operating System related offerings. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Future consideration
Workspace z/OS
Categories LE
Created by Guest
Created on Jul 30, 2020

LE modification for fork thread behaviour

There are multiple instances in the the core python implementation and in pypi packages where a thread calls fork and the child process tries to create a thread using pthread_create but results in an error. 
This error is due to the LE design implementation and relates to the error code:
ELEMULTITHREADFORK - pthread_create() was invoked from a child process created by calling fork() from a multi-threaded process. This child process is restricted from becoming multi-threaded.


A short code example that showcases this behaviour is as follows:
```
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/wait.h>
void * thread_func(void * unused) {
    return NULL;
}
int main() {
    int status = 0;
    pthread_t t1;
    pthread_create(&t1, NULL, thread_func, (void*)NULL);
    int pid = fork();
    if (pid == 0) {
        printf("Child process. \t\tParent_pid: %d Child_pid: %d.\n", getppid(), getpid());
        pthread_t t2;
        errno = 0;
        pthread_create(&t2, NULL, thread_func, (void*)NULL);
        exit(errno);
    } 
    else if (pid > 0) {
        printf("Parent process. \tParent_pid: %d Child_pid: %d.\n", getpid(), pid);
        waitpid(pid, &status, WUNTRACED | WCONTINUED);
        printf("status: %d\n", status);
    } else 
    {
        printf("Error creating child process.\n");
    }
    return 0;
}
```


To be able properly support community-developed code which just works on other platforms, and to lower the friction and barrier to getting new important workloads working on z/OS, we are requesting this feature from LE, that allows the creation of threads invoked from a child process created by calling fork() from a multi-threaded process.


Reference
https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.4.0/com.ibm.zos.v2r4.bpxbd00/ptcrea.htm

Idea priority High