Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
import in execv after fork
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rotem  
View profile  
 More options May 9 2006, 8:15 am
Newsgroups: comp.lang.python
From: "Rotem" <vmal...@gmail.com>
Date: 9 May 2006 05:15:28 -0700
Local: Tues, May 9 2006 8:15 am
Subject: import in execv after fork
Hello,

We have been encountering several deadlocks in a threaded Python
application which calls subprocess.Popen (i.e. fork()) in some of its
threads.

This has occurred on Python 2.4.1 on a 2.4.27 Linux kernel.

Perliminary analysis of the hang shows that the child process blocks
upon entering the execvp function, in which the import_lock is acquired
due to the following line:

def _execvpe(file, args, env=None):
    from errno import ENOENT, ENOTDIR
    ...

It is known that when forking from a pthreaded application, acquisition
attempts on locks which were already locked by other threads while
fork() was called will deadlock.

Due to these oddities I was wondering if it would be better to extract
the above import line from the execvpe call, to prevent lock
acquisition attempts in such cases.

I'd appreciate any opinions you might have on the subject.

Thanks in advance,

Rotem


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rotem  
View profile  
 More options May 9 2006, 8:28 am
Newsgroups: comp.lang.python
From: "Rotem" <vmal...@gmail.com>
Date: 9 May 2006 05:28:25 -0700
Local: Tues, May 9 2006 8:28 am
Subject: Re: import in execv after fork
Another workaround could be re-assigning a new lock to import_lock
(such a thing is done with the global interpreter lock) at
PyOS_AfterFork or pthread_atfork.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »