[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH] Trace into open fd and refactor tracing code.
From:       Linus Torvalds <torvalds () osdl ! org>
Date:       2006-08-31 21:49:44
Message-ID: Pine.LNX.4.64.0608311444200.27779 () g5 ! osdl ! org
[Download RAW message or body]



On Thu, 31 Aug 2006, Junio C Hamano wrote:
> 
> Actually it was me who suggested the use of fd directly, along
> with trying to do one message in a single write (i.e. not doing
> stdio as much as possible).

I definitely agree with the "one message in a single write" thing.

That's in fact required to make sure that O_APPEND works properly (ie that 
you don't have potentially different processes mixing output)

> I somehow felt there would be less interference between writes
> issued by process A and process B, but probably I am mistaken.

The atomicity guarantees are the same regardless of whether you do a 
separate open(), the only thing that matters is that you do want to try to 
do messages with a single "write()" call, and that you use O_APPEND. That 
should guarantee that you get good behaviour.

Without O_APPEND, you would obviously have to share one single file 
descriptor, because otherwise people will just be writing all over each 
other.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic