Re: Updating mmap(2) [nik@freebsd.org: Re: pipe]

2001-02-10 Thread Matt Dillon
:Maybe I'm suffering a temporary lapse of clue, but is there some :place where supplemental info (like code snippets) is kept? This :kind of info might be handy to someone seeing the man page for the :first time, but it doesn't seem quite right to put code samples :in the man pages themselves.

Re: Updating mmap(2) [nik@freebsd.org: Re: pipe]

2001-02-10 Thread Richard Hodges
On Sat, 10 Feb 2001, Matt Dillon wrote: NC: > :> mmap - allocate memory, or map files or devices into memory > :> > :> would be better? > : RH: > :While you're at it :-) maybe you could add a few lines suggesting that > :with the MAP_SHARED flag, this is a useful method of sharing memory

Re: Updating mmap(2) [nik@freebsd.org: Re: pipe]

2001-02-10 Thread Matt Dillon
:> mmap - allocate memory, or map files or devices into memory :> :> would be better? : :You have my vote. That information would have saved me quite a few :hours of angst a few years ago when I was looking for a way to share :memory between processes. In fact, it will probably be an impor

Re: Updating mmap(2) [nik@freebsd.org: Re: pipe]

2001-02-10 Thread Richard Hodges
On Sat, 10 Feb 2001, Nik Clayton wrote: > There was no comment to these. Any objections if I commit my proposed > changes? > mmap - map files or devices into memory > > [...] > > doesn't immediately shout "You can use this function to allocate memory > as well". > > Perhaps > > mm

Updating mmap(2) [nik@freebsd.org: Re: pipe]

2001-02-10 Thread Nik Clayton
"G. Adam Stanislav" <[EMAIL PROTECTED]>, Stephen McKay <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: Re: pipe On Wed, Dec 06, 2000 at 09:50:55AM +0100, Dag-Erling Smorgrav wrote: > "G. Adam Stanislav" <[EMAIL PROTECTED]> writes: > > On Tue, Dec

Re: pipe

2000-12-07 Thread Nik Clayton
On Wed, Dec 06, 2000 at 09:50:55AM +0100, Dag-Erling Smorgrav wrote: > "G. Adam Stanislav" <[EMAIL PROTECTED]> writes: > > On Tue, Dec 05, 2000 at 06:11:06PM +0100, Dag-Erling Smorgrav wrote: > > >The second and third sentences of the second paragraph (the one that > > >starts on line 23), as well

Re: pipe

2000-12-06 Thread Wes Peters
"G. Adam Stanislav" wrote: > > On Mon, Dec 04, 2000 at 12:56:51PM +1000, Stephen McKay wrote: > >Using pipes for temporary storage is still a crazy idea. Pipes can be > >smaller than 8K, depending on the flavour of Unix. > > It was just a thought, and it did not work. :) Other flavors of Unix >

Re: pipe

2000-12-06 Thread Stephen McKay
On Wednesday, 6th December 2000, Dag-Erling Smorgrav wrote: >"G. Adam Stanislav" <[EMAIL PROTECTED]> writes: >> I know it addresses it. Unfortunately, I didn't understand a word of it. > MAP_ANONMap anonymous memory not associated with any specific file. > The file descri

Re: pipe

2000-12-06 Thread Dag-Erling Smorgrav
"G. Adam Stanislav" <[EMAIL PROTECTED]> writes: > On Tue, Dec 05, 2000 at 06:11:06PM +0100, Dag-Erling Smorgrav wrote: > >The second and third sentences of the second paragraph (the one that > >starts on line 23), as well as the entire eighth paragraph (that > >starts on line 45), address the ques

Re: pipe

2000-12-05 Thread Jack Rusher
"G. Adam Stanislav" wrote: > > On Tue, Dec 05, 2000 at 06:11:06PM +0100, Dag-Erling Smorgrav wrote: > >No, you didn't. You probably read the first line, then your eyes > >glazed over and you skipped to the bottom. Dudes. This is a programmer from another environment coming to us to learn more

Re: pipe

2000-12-05 Thread G. Adam Stanislav
On Tue, Dec 05, 2000 at 06:11:06PM +0100, Dag-Erling Smorgrav wrote: >No, you didn't. You probably read the first line, then your eyes >glazed over and you skipped to the bottom. Believe what you want. >The second and third sentences of the second paragraph (the one that >starts on line 23), as

Re: pipe

2000-12-05 Thread Dag-Erling Smorgrav
"G. Adam Stanislav" <[EMAIL PROTECTED]> writes: > On Tue, Dec 05, 2000 at 04:32:29PM +0100, Dag-Erling Smorgrav wrote: > > Did you even read the man page? > Many times, actually. And on different days, too. :) No, you didn't. You probably read the first line, then your eyes glazed over and you sk

Re: pipe

2000-12-05 Thread G. Adam Stanislav
On Tue, Dec 05, 2000 at 03:43:10PM +, Aled Morris wrote: >malloc appears to mmap pages from fd -1, and makes them private and >read/write (except on sparc architecture, where it uses /dev/zero rather >than -1, which makes more sense to me) > >It isn't particularly complicated: > >newmem = mmap

Re: pipe

2000-12-05 Thread G. Adam Stanislav
On Tue, Dec 05, 2000 at 04:32:29PM +0100, Dag-Erling Smorgrav wrote: >Did you even read the man page? Many times, actually. And on different days, too. :) I guess I just don't understand what is meant by "map" in this context. My Unix programming "bible" (POSIX Programmer's Guide) does not even

Re: pipe

2000-12-05 Thread Aled Morris
On Tue, 5 Dec 2000, G. Adam Stanislav wrote: >> Use malloc() instead. > >Unfortunately, that only works in C. :) > >I tried to figure out how to allocate memory, but, so far, was completely >unsuccessful. malloc appears to mmap pages from fd -1, and makes them private and read/write (except on s

Re: pipe

2000-12-05 Thread Dag-Erling Smorgrav
"G. Adam Stanislav" <[EMAIL PROTECTED]> writes: > > Use malloc() instead. > Unfortunately, that only works in C. :) Use mmap() or brk()/sbrk(). > I tried to figure out how to allocate memory, but, so far, was completely > unsuccessful. I studied the source for the C malloc, but did not understan

Re: pipe

2000-12-05 Thread G. Adam Stanislav
On Mon, Dec 04, 2000 at 12:56:51PM +1000, Stephen McKay wrote: >Using pipes for temporary storage is still a crazy idea. Pipes can be >smaller than 8K, depending on the flavour of Unix. It was just a thought, and it did not work. :) Other flavors of Unix are not too important in this case: I'm w

Re: pipe

2000-12-04 Thread Stephen McKay
On Sunday, 3rd December 2000, "G. Adam Stanislav" wrote: >On Sat, Dec 02, 2000 at 10:12:56AM -0700, Wes Peters wrote: >>Yes, you can read from your own pipe, and yes the buffering availabe in >>the pipe is limited. IIRC, the pipe size is 8K. > >Thank you. In that case I'll be better off using ch

Re: pipe

2000-12-02 Thread G. Adam Stanislav
On Sat, Dec 02, 2000 at 10:12:56AM -0700, Wes Peters wrote: >Yes, you can read from your own pipe, and yes the buffering availabe in >the pipe is limited. IIRC, the pipe size is 8K. Thank you. In that case I'll be better off using child processes for what I am working on. But I will use pipes fr

Re: pipe

2000-12-02 Thread Wes Peters
Charlie & wrote: > > Sorry if this is a dumb question, but after years of DOS programming, I > am still discovering the subletiest of Unix: > > When I create a pipe, do I have to use it for interprocess communication > only, or can the same process write to one end and later read from the > othe

Re: pipe race

1999-05-30 Thread Matthew Dillon
Ouch. Definite problems in both the reader and the writer. The writer calculates the writable space before locking, so if you have two simultanious writers where one blocks in uiomove(), both try to write to the same buffer area. *plus* the counters get screwed up (and woul