jvdias <jason.vas.d...@gmail.com> added the comment:

Thanks for responding !

I also think that the the Solaris Python should provide support for prctl .
Well, actually in modern Solaris what can be achieved with "prctl"
can be achieved my mmap()-ping and manipulating the procfs(4) mounted under 
/proc - 
but yes, what I meant was not that process-scope semaphore support
was required to solve the problem solved in the example code for this bug 
report -
actually, there are many other ways of doing that on either Linux or Solaris,
such as with rlimit(1) - but was only that, had process-scope semaphore support 
been available in Python , then the algorithm used by the example would have 
been 
a simple and robust one and suitable for use in Python code ;  but as the 
application 
the example code was originally part of required process-scope semaphores 
anyway , 
and for many other reasons, such as when a process is killed with -9, its 
semaphore
count is automatically adjusted by specifying the SEM_UNDO option, meaning 
another 
"slot" is available, this was the best among several methods investigated .  

Actually, the example code I submitted for this bug report also raises another, 
completely separate issue, which is that any parent using Python fork() MUST 
somehow do a 
fflush() of its standard output and error C stdio file descriptors before doing 
so ; otherwise
the child's first Python "print " statement is prefixed by what was in the 
parent's stdio buffer,
so that more than one initial "log" line can occasionally appear if Python 
"print" is used to
produce the log - but if the parent does 'print "\n"' immediately before 
calling "fork()" 
then both processes proceed with clean buffers and there are no doubled log 
lines . 
Can't Python provide a better print() implementation or a fflush() 
implementation
that will enable print()'s buffers to be flushed ? Perhaps something like 
PERL's IO::Handle::autoflush() ?

Maybe I should raise another "fflush() support required" bug ?

Thanks & Regards,
Jason 

On Thursday 09 April 2009 19:31:31 you wrote:
> 
> R. David Murray <rdmur...@bitdance.com> added the comment:
> 
> In issue5672 Martin said:
> 
>   If somebody would provide a patch that adds prctl to the posix module,
>   that would be fine with me - we have a long tradition of exposing all
>   available system calls if somebody wants them.
> 
> However, you are talking about a System V call, not a posix call, so
> it's not clear to me if the same rules apply.
> 
> I suggest bringing this up on python-ideas.
> 
> (BTW, sys is for python system stuff, not OS system stuff (which goes in
> the 'os' module).
> 
> ----------
> components: +Library (Lib) -Interpreter Core
> nosy: +r.david.murray
> priority:  -> low
> versions:  -Python 2.6, Python 3.0
> 
> _______________________________________
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue5725>
> _______________________________________
>

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5725>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to