Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Troublesome app when scaling it up, how to proceed?



> On 25.10.2007, at 08:39, Gerben Wierda wrote:
>
>  > go via a different route. The main program creates named pipes for
> stdin,
>> stdout and stderr, [...] Reading output from the stderr and stdout
>> named
>> pipes is done in separate threads of the main program. These programs
>> communicate to the main thread using DO.
>
> Pardon my ignorance, what has the suggestion "Use Distributed (NS)
> Objects INSTEAD of filehandles, i.e. pipes" to do with "I use DO
> ADDITIONALY to three filedescriptors INTERNAL"?

Nothing in a stricly logical sense. I was just explaining (to people who
informed me about DO and sent basic examples) that I already am aware of
DO and am using it both internally between threads and in one special case
between a special subprocess and my main program and that it does not
solve my problem.

I cannot use DO for communication because I want to communicate with the
stdin, stdout, stderr of regular unix cli tools like file, tar, openssl,
gpg, perl, sh, etc. Not all of these can be communicated with via DO
directly (only perl using "use Foundation") or used via a linked library
so I do have to communicate with stdin/stderr/stdout of normal cli tools
anyway. It becomes more complex when one has to run privileged
subprocesses from a non-privileged main program as the interface to
privileged subprocesses (AuthExecuteWithPrivileges()) is seriously limited
(no stderr, no pid, no environment passing).

If there would be an NSPrivilegedTask it would become a lot easier. Now I
had to program my own NSPrivilegedTask five years ago and doing that was
far from simple and it required a special stub for starting the subprocess
so I can connect to the named pipes in separate threads in the main
program, report the pid, set the environment.

But I am far from a day-to-day cocoa expert so it could be that I am
overlooking something. As far as my current situation, my setup runs out
of file handles even though I release everything when the subprocess ends
and not more than a few are running in parallel at all times. They are
kept open somehow, or at least they are not returned to the kernel for
some reason, and I cannot figure out why.

G

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Troublesome app when scaling it up, how to proceed? (From: Gerben Wierda <email@hidden>)
 >Re: Troublesome app when scaling it up, how to proceed? (From: David Spooner <email@hidden>)
 >Re: Troublesome app when scaling it up, how to proceed? (From: "Gerben Wierda" <email@hidden>)
 >Re: Troublesome app when scaling it up, how to proceed? (From: Thomas Engelmeier <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.