Re: [9fans] rwlocks on plan9

2011-09-22 Thread Sape Mullender
It's how read and write locks are supposed to work, but your example isn't necessarily how they should be used. The idea is that a piece of data can be kept consistent by *either* • allowing any number of simultaneous readers *or* • a single writer. You can't have simultaneous readers and writers

Re: [9fans] why not halt in x86 multicore

2011-07-04 Thread Sape Mullender
Indeed, there's an assumption that each core manages the TLB by examining the data structures at clock frequency. In a halt, the clock interrupts still happen so I guess there's no need to invalidate the TLBs just before halt. You could set a variable indicating you're halted and cause other core

Re: [9fans] laserjets misery

2011-05-31 Thread Sape Mullender
Dunno about Sharp printers. For an HP inkjet here we have (thanks to Paurea) beanbycoffe beanbean - gs!ljet4+HPJCL+nohead+1200dpi+duplex generic lpdspool lpd generic hp We have no FIFO entries enywhere Sape > I have (I think) the correct /sys/lib/lp/devices line: > > conv con

Re: [9fans] line numbers in troff

2011-05-19 Thread Sape Mullender
I think at the top of the page you set a trap to go off at the next line. In the trap macro you reset the trap for the line after that. And so on, down the page. Sape > Funny you should mention this. I know there is a way (done for patent > applications). I think I can find it in the tro

Re: [9fans] where to get color troff?

2011-04-12 Thread Sape Mullender
> On Tue, Apr 12, 2011 at 2:38 PM, Peter A. Cejchan wrote: > >> do you mean 'graph', or 'chart' ? >> ++pac >> > > right now it's mostly charts. I use these macros for generating color: .de CL \\X'PS \\$1 \\$2 \\$3 setrgbcolor'\\c .. .de BK \\X'PS 0 0 0 setrgbcolor'\\c .. .de EM \\$3\\X'PS 1 0

Re: [9fans] sleep/wakeup bug?

2011-02-25 Thread Sape Mullender
I suppose the use of counting semaphores in sleep/wakeup could help in cases like this (but I'm sure there are still plenty of other scenarios where they might not help). The value of the semaphore would represent something like "number of things to do", so acquire(sema) would (atomically) wait un

Re: [9fans] πp

2010-10-15 Thread Sape Mullender
We pronouce it pie pee > Is it Pi-Ro, or do you actually call it Pipi?

Re: [9fans] πp

2010-10-15 Thread Sape Mullender
Are we talking about πP or 9P? ΠP doesn't have Twalk. It has open, which combines clone, walk, and open from 9P. Before you start jumping up and down and telling me that you can't open without revieing the qids from the walk (to check them for mount points), let me tell you that we are also tack

Re: [9fans] c compiler bug

2010-09-15 Thread Sape Mullender
I agree; packed data structures are a really bad idea. They're used to match some hardware representation of some data structures and that's not good: It's the compiler's prerogative to decide just how the fields should be packed so therefore, the construct is never portable. This is why we have n

Re: [9fans] writing to ctl using fprint and write

2010-07-29 Thread Sape Mullender
> I'm working on some regression testing for my GSoC project and am trying > to understand why > > ctl = open(path("ctl"),ORDWR|OAPPEND); > ts = "chatty9p 1"; // or some other message > > n = fprint(ctl, ts); > > succeeds, while > > n = write(ctl,ts,sizeof(ts)); > > fails. > > Can someon

Re: [9fans] run queues

2010-06-03 Thread Sape Mullender
s been written > like this because traversing the queue might require too much time for > having a lock. > > Phil; > > Sape Mullender wrote: > > Well spotted. But the queue is maintained in a way that > > traversing it while it's being changed cannot cause one > > to

[9fans] run queues

2010-06-03 Thread Sape Mullender
Well spotted. But the queue is maintained in a way that traversing it while it's being changed cannot cause one to address garbage (rnext always contains a pointer to a proc or nil) and, at the label found, the sanity check is performed to see if we really have a proc on the queue in our hands.

[9fans] thread STACK size

2010-05-19 Thread Sape Mullender
> A while ago, while working on btfs, I stumbled upon some sort of > overflow (http://9fans.net/archive/2009/07/77) which was in fact due > to the thread STACK being too small (and hence if I understood > correctly things would get written out of it, in the heap). > To be on the safe side, I have i

Re: [9fans] dial and time out

2009-09-10 Thread Sape Mullender
Threads are great for preventing race conditions. I agree. Many Plan 9 applications (ria, acme, etc.) use a central proc with lots of threads doing the real work of manipulating the state of the application. No locks are required, because the threads explicitly yield by doing channel io or callin

[9fans] dial and time out

2009-09-10 Thread Sape Mullender
If you really mean thread and not proc, then what you suggest won't work. You can't kill a thread that's in the OS without killing the proc conyaining the thread (thereby killing all the other threads as well). You can have the proc catch notes and send a note to the proc which will interrupt any s

Re: [9fans] Race condition in /sys/src/9/pc/trap.c?

2009-07-30 Thread Sape Mullender
> On Thu, 30 Jul 2009, erik quanstrom wrote: > >> On Thu Jul 30 00:05:45 EDT 2009, el...@andrew.cmu.edu wrote: >>> My familiarity with the kernel source code is superficial to say the >>> least, but it seems to me that this code (from /sys/src/9/pc/trap.c) >>> contains a race condition: >>> >>>

Re: [9fans] Using Acme as an external Editor

2009-07-27 Thread Sape Mullender
Take a look at B, which can be used to send a file to acme. Also you may want to familiarize yourself with plumb. > Hello, > > Is there some idiom or method for using Acme as an external editor to some > other program? Say I want to use it as the editor that is spawned when I > do a CVS com

Re: [9fans] strange behaviour of ps under load

2009-07-22 Thread Sape Mullender
Very odd. There are no blocking operations in reading the status file in /proc. The only thing I can think of is that you have something bound (snapfs?) in /proc and that you're hanging on a stale mount point. Is the clock set properly on that machine? Sape > hello > > today i found 9g

Re: [9fans] venti

2009-01-09 Thread Sape Mullender
Yes, but even if one venti always leaves the store in a consistent state, running two may still cause them to wite differemt things to the same place on disk and this is likely to result in havoc. Sape --- Begin Message --- > Hmm. Running two ventis on the same data is, of course, bad. I

Re: [9fans] venti

2009-01-09 Thread Sape Mullender
> i noticed something odd with venti and i am just trying to see if this > is an issue and if this needs to be addressed. > > i think, by default, plan9 installation sets localhost as the address > for venti in plan9.ini. but at some point i wanted venti to announce > any (*) address. for some rea

Re: [9fans] cpu architecture letters

2008-12-11 Thread Sape Mullender
man 2c(1) --- Begin Message --- Is there a cannonical table giving the mapping of CPU type to CPU letter anywhere in the plan9 distribution? e.g. mips -> v 386 -> 8 etc. -Steve--- End Message ---

Re: [9fans] initialization of anonymous structs.

2008-12-04 Thread Sape Mullender
typedef struct A A; typedef struct B B; struct A { int a1; int a2; }; struct B { A; int b1; int b2; }; B bvar = { .B = { .a1 = 2, .b1 = 2, }, }; --- Begin Message --- On Thu, Dec 4, 2008 at 1:07 PM, Gorka Guardiola <[EMAIL PRO

Re: [9fans] Bizarre freeze

2008-08-05 Thread Sape Mullender
I wonder why there is a command to turn on DMA on disks. Could it be that some disks don't work with DMA on? Sape --- Begin Message --- Ran into an interesting one setting up my cpu server. The following reliably freezes the box: # echo dma on >/dev/sdC0/ctl # 9fat: Leaves the console

Re: [9fans] current state of thread programming

2008-07-30 Thread Sape Mullender
>> i don't see how csp is *not* parallel processing. as soon >> as you have more than 1 work process per client, i would call >> that parallel processing. > > It's a kind of parallelism, of course. But since it makes sense, it is > not "parallelism" as the trend is today ;) I don't know what the

Re: [9fans] 9vx and local file systems

2008-07-18 Thread Sape Mullender
> why can't venti and fossil on the same machine be connected by a pipe? That would be far too logical. Sape

Re: [9fans] P9p's mount(1) on linux

2008-06-19 Thread Sape Mullender
> because I'm difficult you may need to [...] >-eric Amen.

Re: [9fans] ms problem

2008-05-14 Thread Sape Mullender
> I just found out that .RS and .RE no longer work - they too keep the > indent. Again, please revert to the older version. > > On May 12, 2008, at 4:26 PM, Pietro Gagliardi wrote: > >> Hello. The just-updated ms macro set for troff has a problem: if you >> use .P1 and .P2, you have an .IP fo

Re: [9fans] Worksheet program

2008-04-01 Thread Sape Mullender
> Thanks to fgb for his help and /sys/src/cmd/tweak.c for parts of the > interface. You might try control(2) instead. See /sys/src/cmd/auth/factotum/fgui.c /sys/src/cmd/bitsy/keyboard.c for examples. Sape

Re: [9fans] bug in echo?

2008-03-26 Thread Sape Mullender
> echo -- -n because we do gnot like that sort of stuff.