pcp
[Top] [All Lists]

Re: Python code vs local: host connections

To: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Subject: Re: Python code vs local: host connections
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Tue, 17 Sep 2013 19:01:26 -0400 (EDT)
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <y0m7gefp6ch.fsf@xxxxxxxx>
References: <100234653.22684536.1379397669579.JavaMail.root@xxxxxxxxxx> <503959600.22684715.1379397714223.JavaMail.root@xxxxxxxxxx> <y0m61tzr1vf.fsf@xxxxxxxx> <y0m7gefp6ch.fsf@xxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: Wlgkkd7/2ALSjidHJDe4wBEpvkOWdg==
Thread-topic: Python code vs local: host connections

----- Original Message -----
> 
> I wrote:
> 
> > While the new implementation of pmGetContextHostName does a strdup,
> > it's not documented to do that.  [...]
> 
> Perhaps we could backtrack on that, and instead use a static char[...]
> in that function; strcpy strings into that, return its pointer.
> Thread-unsafe, yeah, but it would still be an improvement over the
> status quo ante, because the race conditions there were worse:
> pointers into dynamic pmcd context objects were being returned.  With
> the static-char[] case, at worst multithreaded apps could suffer from
> some string content corruption.

*nod* - sounds good to me.  (Dave?)

Further testing found that python change (the ctypes bit) to be b0rked,
so I've backed that part out anyway.  This suggested change is going to
further simplify the python API fixup, so I'm all for it.

cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>