You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Steve Hay <st...@uk.radan.com> on 2003/10/21 13:24:47 UTC

[PATCH mp2] Skip getppid() test on Win32

The attached patch skips the new getppid() test (perl/api.t) on Win32 
since getppid() is unimplemented on this platform!

- Steve

Re: [PATCH mp2] Skip getppid() test on Win32

Posted by Stas Bekman <st...@stason.org>.
Steve Hay wrote:
> Stas Bekman wrote:
> 
>> I guess nobody has tried using Apache::VMonitor on win32 then. We need 
>> to get the pid of the parent process in order to calculate the real 
>> mem usage (taking the sharing into an account). Doesn't win32 
>> implement shared memory? I suppose not, since the is no fork. Am I 
>> correct? 
> 
> 
> I had a look at Apache::VMonitor once, ages ago, when I read about it in 
> the old "mod_perl guide", but it required GTop, which in turn required 
> libgtop, which I couldn't even begin to figure out how to build on Win32 
> :-(

Of course, that's why it won't work there anyway. Thanks for reminding me 
that. I wish Perl had a cross-platform version of gtop (or alike).

> AFAIK Win32 doesn't have SysV IPC shared memory.  At least, when I 
> looked at IPC-ShareLite & IPC-SharedCache (which HTML-Template can make 
> use of) I didn't get very far.

I suppose that's because SusV IPC based on fork(2).

> But the Win32 API docs do say it "uses a special case of file mapping to 
> provide shared memory access between processes", and there is a (MSV)C++ 
> class called CSharedFile, derived from CMemFile, that supports shared 
> memory files.  No idea if Apache/mod_perl makes use of this, though.  
> Probably not, I guess.

You would have to ask William Rowe about that. He would sure know this stuff, 
since he coded the winnt mpm and big chunks of win32 apr lib single handed.

Since win32 is for the first time becomes a usable platform for mod_perl, it'd 
be interesting to learn about memory deployment patterns on it with regards to 
mod_perl. I suppose that since it's pure threads on win32, the only benefit 
you'd get is the shared Perl opcode tree. And of course the memory usage 
should stay steady (if there are no leaks) since there is no memory to be 
unshared.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH mp2] Skip getppid() test on Win32

Posted by Steve Hay <st...@uk.radan.com>.
Stas Bekman wrote:

> I guess nobody has tried using Apache::VMonitor on win32 then. We need 
> to get the pid of the parent process in order to calculate the real 
> mem usage (taking the sharing into an account). Doesn't win32 
> implement shared memory? I suppose not, since the is no fork. Am I 
> correct? 

I had a look at Apache::VMonitor once, ages ago, when I read about it in 
the old "mod_perl guide", but it required GTop, which in turn required 
libgtop, which I couldn't even begin to figure out how to build on Win32 :-(

AFAIK Win32 doesn't have SysV IPC shared memory.  At least, when I 
looked at IPC-ShareLite & IPC-SharedCache (which HTML-Template can make 
use of) I didn't get very far.

But the Win32 API docs do say it "uses a special case of file mapping to 
provide shared memory access between processes", and there is a (MSV)C++ 
class called CSharedFile, derived from CMemFile, that supports shared 
memory files.  No idea if Apache/mod_perl makes use of this, though.  
Probably not, I guess.

- Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH mp2] Skip getppid() test on Win32

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Tue, 21 Oct 2003, Stas Bekman wrote:
> 
> 
>>Steve Hay wrote:
>>
>>>Steve Hay wrote:
>>>
>>>
>>>>The attached patch skips the new getppid() test (perl/api.t) on Win32
>>>>since getppid() is unimplemented on this platform!
>>
>>Weird:
>>
>>% perldoc -f getppid
>>=item getppid
>>
>>Returns the process id of the parent process.
>>
>>Is it a bug in perl? why a non-portable function lives in perlfunc.pod?
> 
> 
> I think the portability issues have been relegated to
> perlport.pod, which reports that getppid is indeed
> unimplemented on Win32.
> 
> 
>>Doesn't POSIX.pm provide a similar implementation?
> 
> 
> It's also unimplemented under POSIX.pm.

Thank Randy. I've applied Steve's patch. Thanks Steve.

I guess nobody has tried using Apache::VMonitor on win32 then. We need to get 
the pid of the parent process in order to calculate the real mem usage (taking 
the sharing into an account). Doesn't win32 implement shared memory? I suppose 
not, since the is no fork. Am I correct?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH mp2] Skip getppid() test on Win32

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 21 Oct 2003, Stas Bekman wrote:

> Steve Hay wrote:
> > Steve Hay wrote:
> >
> >> The attached patch skips the new getppid() test (perl/api.t) on Win32
> >> since getppid() is unimplemented on this platform!
>
> Weird:
>
> % perldoc -f getppid
> =item getppid
>
> Returns the process id of the parent process.
>
> Is it a bug in perl? why a non-portable function lives in perlfunc.pod?

I think the portability issues have been relegated to
perlport.pod, which reports that getppid is indeed
unimplemented on Win32.

> Doesn't POSIX.pm provide a similar implementation?

It's also unimplemented under POSIX.pm.

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH mp2] Skip getppid() test on Win32

Posted by Stas Bekman <st...@stason.org>.
Steve Hay wrote:
> Steve Hay wrote:
> 
>> The attached patch skips the new getppid() test (perl/api.t) on Win32 
>> since getppid() is unimplemented on this platform! 

Weird:

% perldoc -f getppid
=item getppid

Returns the process id of the parent process.

Is it a bug in perl? why a non-portable function lives in perlfunc.pod?

Doesn't POSIX.pm provide a similar implementation?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH mp2] Skip getppid() test on Win32

Posted by Steve Hay <st...@uk.radan.com>.
Steve Hay wrote:

> The attached patch skips the new getppid() test (perl/api.t) on Win32 
> since getppid() is unimplemented on this platform! 

Use this version instead.

(I cut-and-pasted the skip code from modperl/request_rec_tie_api.t, but 
the Perl version is not really relevant here.)

- Steve