* uslurp change
@ 2007-07-17 20:25 Mike Cvet
2007-07-17 20:32 ` Phil Muldoon
0 siblings, 1 reply; 3+ messages in thread
From: Mike Cvet @ 2007-07-17 20:25 UTC (permalink / raw)
To: frysk
Code in frysk-sys/proc/cni/slurp.cxx : uslurp which previously was:
int fd = ::open (file, O_RDONLY);
if (errno != 0) {
::free(buf);
return NULL;
Has been changed to replicate behaviour seen in FileDescriptor.cxx
where, if the maximum number of file descriptors has been reached, the
garbage collector will be continually prodded until some descriptors get
freed up.
- Mike
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: uslurp change
2007-07-17 20:25 uslurp change Mike Cvet
@ 2007-07-17 20:32 ` Phil Muldoon
2007-07-18 18:25 ` Mike Cvet
0 siblings, 1 reply; 3+ messages in thread
From: Phil Muldoon @ 2007-07-17 20:32 UTC (permalink / raw)
To: Mike Cvet; +Cc: frysk
Mike Cvet wrote:
> Code in frysk-sys/proc/cni/slurp.cxx : uslurp which previously was:
>
> int fd = ::open (file, O_RDONLY);
> if (errno != 0) {
> ::free(buf);
> return NULL;
>
> Has been changed to replicate behaviour seen in FileDescriptor.cxx
> where, if the maximum number of file descriptors has been reached, the
> garbage collector will be continually prodded until some descriptors
> get freed up.
>
Mike
uslurp is a "special case" function for /proc/$$/maps which can be
large. It does the realloc dance on multiple 4k page reads while slurp
just reads one page from /proc. The older slurp still does the vast
majority of reads from /proc, so this optimization will be needed there
to. I cannot think of a reason why I just did not replace uslurp with
slurp many moons ago, but thinking about it, it probably should.
Regards
Phil
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: uslurp change
2007-07-17 20:32 ` Phil Muldoon
@ 2007-07-18 18:25 ` Mike Cvet
0 siblings, 0 replies; 3+ messages in thread
From: Mike Cvet @ 2007-07-18 18:25 UTC (permalink / raw)
To: Phil Muldoon; +Cc: frysk
Phil Muldoon wrote:
> uslurp is a "special case" function for /proc/$$/maps which can be
> large. It does the realloc dance on multiple 4k page reads while slurp
> just reads one page from /proc. The older slurp still does the vast
> majority of reads from /proc, so this optimization will be needed
> there to. I cannot think of a reason why I just did not replace uslurp
> with slurp many moons ago, but thinking about it, it probably should.
>
The update has been added to slurp() and slurp_thread() as well, through
a new method in Errno.cxx called tryOpen().
- Mike
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-18 18:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-17 20:25 uslurp change Mike Cvet
2007-07-17 20:32 ` Phil Muldoon
2007-07-18 18:25 ` Mike Cvet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).