Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - forking of a process with threads: (7 Items)
   
forking of a process with threads  
I read in Rob Krten's "Getting Started with QNX Neutrino: A Guide for Realtime Programmers" Oct 20, 2008, page 35, that 
forking of a process with threads was not allowed because of mutex ownership issues. However, he thought in the future 
that may change. In that book, Rob also noted that pthreat_atfork() includes a solution to that mutex issue, but that "
the functionality of calling pthread_atfork() isn't being used by all the mutexes in the Neutrino C library ..."

Does anyone know about a change to the above and, if so, of an article that explains of the current situation of forking
 off from processes with threads?

I humbly await a SIGTIP,

Luiz

PS.: If you don't mind, please, CC me to costal@ferris.edu.
RE: forking of a process with threads  

> Does anyone know about a change to the above and, if so, of an article that explains of the current situation of 
forking off from processes with threads?

It's in progress.  It should be in 6.6.

Regards,

-seanb

Attachment: Text winmail.dat 2.32 KB
Re: forking of a process with threads  
On Mon, 2010-06-28 at 18:06 -0400, Luiz Costa wrote:
> I read in Rob Krten's "Getting Started with QNX Neutrino: A Guide for
> Realtime Programmers" Oct 20, 2008, page 35, that forking of a process
> with threads was not allowed because of mutex ownership issues.
> However, he thought in the future that may change. In that book, Rob
> also noted that pthreat_atfork() includes a solution to that mutex
> issue, but that "the functionality of calling pthread_atfork() isn't
> being used by all the mutexes in the Neutrino C library ..."
> 
> Does anyone know about a change to the above and, if so, of an article
> that explains of the current situation of forking off from processes
> with threads?

The upcoming 6.5.0 release includes a libc with support for forking in
the presence of threads.  Note that only libc has had atfork handlers
added: no analysis has yet been done on the broader array of libraries.
If you're lucky, they'll just work =)

Regards,
Neil
Re: forking of a process with threads  
On Tue, Jun 29, 2010 at 10:12:27AM -0400, Neil Schellenberger wrote:
> On Mon, 2010-06-28 at 18:06 -0400, Luiz Costa wrote:
> > I read in Rob Krten's "Getting Started with QNX Neutrino: A Guide for
> > Realtime Programmers" Oct 20, 2008, page 35, that forking of a process
> > with threads was not allowed because of mutex ownership issues.
> > However, he thought in the future that may change. In that book, Rob
> > also noted that pthreat_atfork() includes a solution to that mutex
> > issue, but that "the functionality of calling pthread_atfork() isn't
> > being used by all the mutexes in the Neutrino C library ..."
> > 
> > Does anyone know about a change to the above and, if so, of an article
> > that explains of the current situation of forking off from processes
> > with threads?
> 
> The upcoming 6.5.0 release includes a libc with support for forking in
> the presence of threads.  Note that only libc has had atfork handlers
> added: no analysis has yet been done on the broader array of libraries.
> If you're lucky, they'll just work =)
> 

Actually, it's about half done.  We haven't flipped the switch
in fork.c :)

-seanb
Re: forking of a process with threads  
On Tue, 2010-06-29 at 10:15 -0400, Sean Boudreau wrote:
> Actually, it's about half done.  We haven't flipped the switch
> in fork.c :)

Oops.  My mistake =)  I thought that we had already flipped it.
Re: forking of a process with threads  
That's because there is procnto work to be done yet - a forked process 
does not get it's mutexes copied over
yet.

On 10-06-29 10:15 AM, Sean Boudreau wrote:
> On Tue, Jun 29, 2010 at 10:12:27AM -0400, Neil Schellenberger wrote:
>    
>> On Mon, 2010-06-28 at 18:06 -0400, Luiz Costa wrote:
>>      
>>> I read in Rob Krten's "Getting Started with QNX Neutrino: A Guide for
>>> Realtime Programmers" Oct 20, 2008, page 35, that forking of a process
>>> with threads was not allowed because of mutex ownership issues.
>>> However, he thought in the future that may change. In that book, Rob
>>> also noted that pthreat_atfork() includes a solution to that mutex
>>> issue, but that "the functionality of calling pthread_atfork() isn't
>>> being used by all the mutexes in the Neutrino C library ..."
>>>
>>> Does anyone know about a change to the above and, if so, of an article
>>> that explains of the current situation of forking off from processes
>>> with threads?
>>>        
>> The upcoming 6.5.0 release includes a libc with support for forking in
>> the presence of threads.  Note that only libc has had atfork handlers
>> added: no analysis has yet been done on the broader array of libraries.
>> If you're lucky, they'll just work =)
>>
>>      
> Actually, it's about half done.  We haven't flipped the switch
> in fork.c :)
>
> -seanb
>
>
>
> _______________________________________________
>
> OSMeta
> http://community.qnx.com/sf/go/post58067
>
>    

-- 
cburgess@qnx.com
Re: forking of a process with threads  
On Tue, 2010-06-29 at 10:29 -0400, Colin Burgess wrote:
> That's because there is procnto work to be done yet - a forked process 
> does not get it's mutexes copied over
> yet.

Again, my apologies.  I thought that had made it in for 6.5.0.  I'll
crawl back under my rock now....