9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] venti
@ 2007-10-04  1:51 Russ Cox
  2007-10-07 20:51 ` Steve Simon
  0 siblings, 1 reply; 18+ messages in thread
From: Russ Cox @ 2007-10-04  1:51 UTC (permalink / raw)
  To: 9fans

I have fixed the sync livelock bug that anothy and others reported.

To make it easier to debug problems in the future (and to inspect
your venti servers from other machines), I suggest changing your
plan9.ini from reading

	venti=/dev/sdC0/arenas

to

	venti=/dev/sdC0/arenas tcp!127.1!17034 tcp!*!8000

The two additional addresses are where venti listens for venti
and http traffic, respectively.  The defaults are tcp!127.1!17034
and tcp!127.1!8000.  Using * instead of 127.1 in the latter will
make it so the http server is accessible from other machines.
(If you want to make your venti server accessible too, change
the first address to tcp!*!17034.) The default is 127.1 for
security reasons.

Having done this, you will be able to load pages like

	http://venti:8000/proc/threads

to get a list of threads and what code they are blocked in.  And

	http://venti:8000/proc/stacks

will give the stack for each thread, much like running stacks()
in an "acid -l thread" session.

If you do encounter problems where venti appears to be
hung in some form, I would appreciate if you could save
the output of 

	http://venti:8000/proc/all

and mail it to me when reporting the problem. 

Note that although there are new venti binaries on sources,
the kernels do not yet use the new venti.  If you boot from 
a combined venti+fossil server, you will need to rebuild 
9pccpuf/9pcf yourself in order to get it.

Thanks.
Russ



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

* Re: [9fans] venti
  2007-10-04  1:51 [9fans] venti Russ Cox
@ 2007-10-07 20:51 ` Steve Simon
  2007-10-08  7:02   ` [9fans] here document arisawa
  0 siblings, 1 reply; 18+ messages in thread
From: Steve Simon @ 2007-10-07 20:51 UTC (permalink / raw)
  To: 9fans


> I have fixed the sync livelock bug that anothy and others reported.

I too had the "hangs at conf..." problem but it seemed to go
away when I disabled a cpu.

The latest change to venti has solved my problems and I
am back on two cpus.

Thanks,

-Steve


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

* [9fans] here document
  2007-10-07 20:51 ` Steve Simon
@ 2007-10-08  7:02   ` arisawa
  2007-10-08  7:46     ` sqweek
  0 siblings, 1 reply; 18+ messages in thread
From: arisawa @ 2007-10-08  7:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

It seems "here document" in rc function is not working.
Try:

fn foo {
cat <<'EOD'
World
EOD
}

echo Hello
foo

Kenji Arisawa



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

* Re: [9fans] here document
  2007-10-08  7:02   ` [9fans] here document arisawa
@ 2007-10-08  7:46     ` sqweek
  2007-10-08 11:59       ` arisawa
  0 siblings, 1 reply; 18+ messages in thread
From: sqweek @ 2007-10-08  7:46 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 10/8/07, arisawa@ar.aichi-u.ac.jp <arisawa@ar.aichi-u.ac.jp> wrote:
> It seems "here document" in rc function is not working.
> Try:
>
> fn foo {
> cat <<'EOD'
> World
> EOD
> }
>
> echo Hello
> foo

 Your syntax is wrong. In rc the here document comes after the closing
brace, as in:

for(i in 1 2 3) {
cat <<EOF
}
Hello
EOF

 However, note the BUGS section of rc(1): "Functions that use here
documents don't work."
-sqweek


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

* Re: [9fans] here document
  2007-10-08  7:46     ` sqweek
@ 2007-10-08 11:59       ` arisawa
  2007-10-08 12:12         ` erik quanstrom
  2007-10-10  0:37         ` [9fans] here document Scott Schwartz
  0 siblings, 2 replies; 18+ messages in thread
From: arisawa @ 2007-10-08 11:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>
>  Your syntax is wrong. In rc the here document comes after the closing
> brace, as in:
>
> for(i in 1 2 3) {
> cat <<EOF
> }
> Hello
> EOF
>

dreadful!

>  However, note the BUGS section of rc(1): "Functions that use here
> documents don't work."

I didn't aware...
Thanks

Kenji Arisawa




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

* Re: [9fans] here document
  2007-10-08 11:59       ` arisawa
@ 2007-10-08 12:12         ` erik quanstrom
  2007-10-08 12:47           ` roger peppe
  2007-10-10  0:37         ` [9fans] here document Scott Schwartz
  1 sibling, 1 reply; 18+ messages in thread
From: erik quanstrom @ 2007-10-08 12:12 UTC (permalink / raw)
  To: 9fans

> dreadful!
> 
>>  However, note the BUGS section of rc(1): "Functions that use here
>> documents don't work."
> 
> I didn't aware...
> Thanks
> 
> Kenji Arisawa

here documents can always be replaced.  you can replace the block
between <<LABEL and LABEL with a quoted block if you s/'/''/g.

with rc's regular quoting rules, i was suprised that rc included them.
i think the language would be better without here documents.

- erik



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

* Re: [9fans] here document
  2007-10-08 12:12         ` erik quanstrom
@ 2007-10-08 12:47           ` roger peppe
  2007-10-08 13:09             ` erik quanstrom
  0 siblings, 1 reply; 18+ messages in thread
From: roger peppe @ 2007-10-08 12:47 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> with rc's regular quoting rules, i was suprised that rc included them.
> i think the language would be better without here documents.

here files are still useful because they don't use
memory proportional to their size, so you
can have a 100MB here file without worrying too much.
that's why they don't work in functions (byron's rc
converted a here file within a function into a "here string"
which basically amounted to {echo string | command}
but with the here file syntax; not much point in that,
save for regularity)


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

* Re: [9fans] here document
  2007-10-08 12:47           ` roger peppe
@ 2007-10-08 13:09             ` erik quanstrom
  2007-10-08 14:02               ` roger peppe
  0 siblings, 1 reply; 18+ messages in thread
From: erik quanstrom @ 2007-10-08 13:09 UTC (permalink / raw)
  To: 9fans

> here files are still useful because they don't use
> memory proportional to their size, so you
> can have a 100MB here file without worrying too much.
> that's why they don't work in functions (byron's rc
> converted a here file within a function into a "here string"
> which basically amounted to {echo string | command}
> but with the here file syntax; not much point in that,
> save for regularity)

i don't find this to be a compelling argument.  i have yet to
see a 100MB here document.  (i don't think a 100MB here
document would be a problem for most.)  in most cases,
a large file can be moved outside the script anyway.

bundles aren't used much anymore, but i wrote a bundle
program for a shell without here documents but with the same
quoting rules as rc.  it worked well.

- erik



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

* Re: [9fans] here document
  2007-10-08 13:09             ` erik quanstrom
@ 2007-10-08 14:02               ` roger peppe
  2007-10-08 15:14                 ` erik quanstrom
  0 siblings, 1 reply; 18+ messages in thread
From: roger peppe @ 2007-10-08 14:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> i don't find this to be a compelling argument.

to be honest, i tend to agree with you, which is
why i didn't put here documents into the inferno shell.

but just occasionally i pine for the clarity of
here-files-as-templates. no need to quote quotes.

in the past i've contemplated adding a new type
of quote to the shell, consisting of a bunch of lines
all starting with some special character. that way they
read nicely, and nest nicely too.

echo \
»ls -l
»echo \
»»who's askin'

which with normal quoting rules would be

echo 'ls -l
echo ''who''''s askin'''''''

which isn't quite so readable.

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

* Re: [9fans] here document
  2007-10-08 14:02               ` roger peppe
@ 2007-10-08 15:14                 ` erik quanstrom
  2007-10-08 16:34                   ` [9fans] International Workshop on Plan 9 Sape Mullender
  0 siblings, 1 reply; 18+ messages in thread
From: erik quanstrom @ 2007-10-08 15:14 UTC (permalink / raw)
  To: 9fans

On Mon Oct  8 10:02:51 EDT 2007, rogpeppe@gmail.com wrote:
> > i don't find this to be a compelling argument.
> 
> to be honest, i tend to agree with you, which is
> why i didn't put here documents into the inferno shell.
> 
> but just occasionally i pine for the clarity of
> here-files-as-templates. no need to quote quotes.

i don't disagree.

ironicly, /sys/lib/newuser, one of the few places that here docs are
used, has to mangle it's document to quote '$'.  variable substitution
is not always a good thing.

- erik


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

* [9fans] International Workshop on Plan 9
  2007-10-08 15:14                 ` erik quanstrom
@ 2007-10-08 16:34                   ` Sape Mullender
  0 siblings, 0 replies; 18+ messages in thread
From: Sape Mullender @ 2007-10-08 16:34 UTC (permalink / raw)
  To: 9fans

Since we could use a few more papers for the Plan 9 Workshop
(see plan9.bell-labs.com/iwp9) we're extending the deadline
for submission by two weeks and we're going to allow submission
of extended abstracts as well as full  papers.

The new deadline is October 19th.  Acceptance notification may
also be delayed by a few days.

	Sape



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

* Re: [9fans] here document
  2007-10-08 11:59       ` arisawa
  2007-10-08 12:12         ` erik quanstrom
@ 2007-10-10  0:37         ` Scott Schwartz
  2007-10-10  0:46           ` erik quanstrom
  1 sibling, 1 reply; 18+ messages in thread
From: Scott Schwartz @ 2007-10-10  0:37 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

| >  However, note the BUGS section of rc(1): "Functions that use here
| > documents don't work."

Byron's rc works!

; fn zot {
for (a in 1 2 3) {
cat <<EOF
Hello
World
EOF
}
}
; zot
Hello
World
Hello
World
Hello
World



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

* Re: [9fans] here document
  2007-10-10  0:37         ` [9fans] here document Scott Schwartz
@ 2007-10-10  0:46           ` erik quanstrom
  2007-10-19  6:20             ` arisawa
  0 siblings, 1 reply; 18+ messages in thread
From: erik quanstrom @ 2007-10-10  0:46 UTC (permalink / raw)
  To: 9fans

> Byron's rc works!
> 
> ; fn zot {
> for (a in 1 2 3) {
> cat <<EOF
> Hello
> World
> EOF
> }
> }
> ; zot
> Hello
> World
> Hello
> World
> Hello
> World

however the price is the entire contents of the here doc is
in memory.

- erik


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

* Re: [9fans] here document
  2007-10-10  0:46           ` erik quanstrom
@ 2007-10-19  6:20             ` arisawa
  2007-10-19 10:59               ` erik quanstrom
  0 siblings, 1 reply; 18+ messages in thread
From: arisawa @ 2007-10-19  6:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Current rc uses temporal file in cooking here doc.
However I prefer that entire contents of the here doc is in memory.
Now memory is cheap and I never write so much contents in here doc.
Speed and readability is much important for me.

Kenji Arisawa

On 2007/10/10, at 9:46, erik quanstrom wrote:

>> Byron's rc works!
>>
>> ; fn zot {
>> for (a in 1 2 3) {
>> cat <<EOF
>> Hello
>> World
>> EOF
>> }
>> }
>> ; zot
>> Hello
>> World
>> Hello
>> World
>> Hello
>> World
>
> however the price is the entire contents of the here doc is
> in memory.
>
> - erik



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

* Re: [9fans] here document
  2007-10-19  6:20             ` arisawa
@ 2007-10-19 10:59               ` erik quanstrom
  2007-10-19 12:44                 ` Martin Neubauer
  0 siblings, 1 reply; 18+ messages in thread
From: erik quanstrom @ 2007-10-19 10:59 UTC (permalink / raw)
  To: 9fans

> Current rc uses temporal file in cooking here doc.
> However I prefer that entire contents of the here doc is in memory.
> Now memory is cheap and I never write so much contents in here doc.
> Speed and readability is much important for me.
> 
> Kenji Arisawa

the main argument i can see for having here documents at all
is that they can be arbitrarily long.  if you put the whole thing
in memory, they would loose there reason for being.  why not
just use quotes?

- erik



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

* Re: [9fans] here document
  2007-10-19 10:59               ` erik quanstrom
@ 2007-10-19 12:44                 ` Martin Neubauer
  2007-10-19 13:25                   ` erik quanstrom
  0 siblings, 1 reply; 18+ messages in thread
From: Martin Neubauer @ 2007-10-19 12:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I think it is considerably easier to create here documents on the fly (eg.
awk output) than correctly quoted strings. But for me the memory vs. temp
file argument is largely irrelevant, due to ramfs.

	Martin

* erik quanstrom (quanstro@quanstro.net) wrote:
> the main argument i can see for having here documents at all
> is that they can be arbitrarily long.  if you put the whole thing
> in memory, they would loose there reason for being.  why not
> just use quotes?
> 
> - erik


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

* Re: [9fans] here document
  2007-10-19 12:44                 ` Martin Neubauer
@ 2007-10-19 13:25                   ` erik quanstrom
  2007-10-19 13:56                     ` Martin Neubauer
  0 siblings, 1 reply; 18+ messages in thread
From: erik quanstrom @ 2007-10-19 13:25 UTC (permalink / raw)
  To: 9fans

> I think it is considerably easier to create here documents on the fly (eg.
> awk output) than correctly quoted strings. 

that's the beauty of rc-style quoting.  a simple sed script is enough
to stuff '.  it's easy to do this on the fly.  your awk script needn't
know.  i wrote a bundle-like utility ~10 years ago for a shell i wrote
that used this trick as my shell didn't have here documents.

> But for me the memory vs. temp
> file argument is largely irrelevant, due to ramfs.

what does that mean?  surely you're not running ramfs from
your profile.

- erik



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

* Re: [9fans] here document
  2007-10-19 13:25                   ` erik quanstrom
@ 2007-10-19 13:56                     ` Martin Neubauer
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Neubauer @ 2007-10-19 13:56 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

* erik quanstrom (quanstro@quanstro.net) wrote:
> > But for me the memory vs. temp
> > file argument is largely irrelevant, due to ramfs.
> 
> what does that mean?  surely you're not running ramfs from
> your profile.

No, but if you want here documents in memory you don't have to bother with
implementing that in the rc binary. Just starting ramfs before running the
script in question is enough. That takes care of almost all cases where that
might be useful. If someone uses here documents in the profile that are so
so big that those not being held in memory is a performance issue, there's
probably so much wrong going on that I wouldn't bother anyway. And I agree,
the rc quoting makes generating input quite painless. Personally, I usually
feel the need for here documents when writing shell scripts on systems where
no rc is available.

	Martin



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

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

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-04  1:51 [9fans] venti Russ Cox
2007-10-07 20:51 ` Steve Simon
2007-10-08  7:02   ` [9fans] here document arisawa
2007-10-08  7:46     ` sqweek
2007-10-08 11:59       ` arisawa
2007-10-08 12:12         ` erik quanstrom
2007-10-08 12:47           ` roger peppe
2007-10-08 13:09             ` erik quanstrom
2007-10-08 14:02               ` roger peppe
2007-10-08 15:14                 ` erik quanstrom
2007-10-08 16:34                   ` [9fans] International Workshop on Plan 9 Sape Mullender
2007-10-10  0:37         ` [9fans] here document Scott Schwartz
2007-10-10  0:46           ` erik quanstrom
2007-10-19  6:20             ` arisawa
2007-10-19 10:59               ` erik quanstrom
2007-10-19 12:44                 ` Martin Neubauer
2007-10-19 13:25                   ` erik quanstrom
2007-10-19 13:56                     ` Martin Neubauer

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).