9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] getting a pid from threadpostmountsrv
@ 2007-06-10  1:39 Skip Tavakkolian
  2007-06-10 14:49 ` Russ Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Skip Tavakkolian @ 2007-06-10  1:39 UTC (permalink / raw)
  To: 9fans

is there an easy way to get the pid of the proc that
threadpostmountsrv creates to run srv()?

thought about sending the current pid over a global
channel in Srv.attach(); seems wrong. maybe a
Srv.start() is warranted?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] getting a pid from threadpostmountsrv
  2007-06-10  1:39 [9fans] getting a pid from threadpostmountsrv Skip Tavakkolian
@ 2007-06-10 14:49 ` Russ Cox
  2007-06-10 15:57   ` Skip Tavakkolian
  0 siblings, 1 reply; 7+ messages in thread
From: Russ Cox @ 2007-06-10 14:49 UTC (permalink / raw)
  To: 9fans

> is there an easy way to get the pid of the proc that
> threadpostmountsrv creates to run srv()?
>
> thought about sending the current pid over a global
> channel in Srv.attach(); seems wrong. maybe a
> Srv.start() is warranted?

why do you care?

russ



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] getting a pid from threadpostmountsrv
  2007-06-10 14:49 ` Russ Cox
@ 2007-06-10 15:57   ` Skip Tavakkolian
  2007-06-10 16:14     ` Russ Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Skip Tavakkolian @ 2007-06-10 15:57 UTC (permalink / raw)
  To: 9fans

> why do you care?

i handle part of a ns that is exported, with an in-proc
server.  i need to be able to post a note to it.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] getting a pid from threadpostmountsrv
  2007-06-10 15:57   ` Skip Tavakkolian
@ 2007-06-10 16:14     ` Russ Cox
  2007-06-10 17:32       ` Skip Tavakkolian
  2007-06-10 18:52       ` Skip Tavakkolian
  0 siblings, 2 replies; 7+ messages in thread
From: Russ Cox @ 2007-06-10 16:14 UTC (permalink / raw)
  To: 9fans

> i handle part of a ns that is exported, with an in-proc
> server.  i need to be able to post a note to it.

why?

i know this line of questioning is annoying, but
unless you are posting the note to interrupt a
system call, it's really not a good idea to have
notes flying around in threaded programs.
the problem is that notes can come in at arbitrary
times and really screw things up in unexpected ways.
there is always a better, more coordinated way.

and in the case of interrupting a system call
you'd be better off using iocall and iointerrupt.

russ



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] getting a pid from threadpostmountsrv
  2007-06-10 16:14     ` Russ Cox
@ 2007-06-10 17:32       ` Skip Tavakkolian
  2007-06-10 19:56         ` Russ Cox
  2007-06-10 18:52       ` Skip Tavakkolian
  1 sibling, 1 reply; 7+ messages in thread
From: Skip Tavakkolian @ 2007-06-10 17:32 UTC (permalink / raw)
  To: 9fans

> why?

shouldn't an in-prog fs -- notefs in cpu.c -- be possible with lib9p?

for snsa ref implementaton, a sibling proc running srv() handles
/dev/sysctl, that controls the workings of the agent.  agent needs to
be able to kill the srv proc if the exec'd exportfs dies.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] getting a pid from threadpostmountsrv
  2007-06-10 16:14     ` Russ Cox
  2007-06-10 17:32       ` Skip Tavakkolian
@ 2007-06-10 18:52       ` Skip Tavakkolian
  1 sibling, 0 replies; 7+ messages in thread
From: Skip Tavakkolian @ 2007-06-10 18:52 UTC (permalink / raw)
  To: 9fans

> and in the case of interrupting a system call
> you'd be better off using iocall and iointerrupt.

for now, setting Srv.leavefdsopen has the right effect. it
also leaves the proc in the same process group.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] getting a pid from threadpostmountsrv
  2007-06-10 17:32       ` Skip Tavakkolian
@ 2007-06-10 19:56         ` Russ Cox
  0 siblings, 0 replies; 7+ messages in thread
From: Russ Cox @ 2007-06-10 19:56 UTC (permalink / raw)
  To: 9fans

> shouldn't an in-prog fs -- notefs in cpu.c -- be possible with lib9p?
>
> for snsa ref implementaton, a sibling proc running srv() handles
> /dev/sysctl, that controls the workings of the agent.  agent needs to
> be able to kill the srv proc if the exec'd exportfs dies.

sure but you didn't answer the question of why you are
sending notes.  if you just want to clean up on exit
you can use threadexitsall and the right things happen.
if you are trying to kill off one proc but not the whole
program using a note, you are asking for trouble.

russ



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-06-10 19:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-10  1:39 [9fans] getting a pid from threadpostmountsrv Skip Tavakkolian
2007-06-10 14:49 ` Russ Cox
2007-06-10 15:57   ` Skip Tavakkolian
2007-06-10 16:14     ` Russ Cox
2007-06-10 17:32       ` Skip Tavakkolian
2007-06-10 19:56         ` Russ Cox
2007-06-10 18:52       ` Skip Tavakkolian

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 NNTP newsgroup(s).