Re: Want to know something about mlock or shmctl via SHMLOCK
- From: "sorcerer" <nagual.hsu@xxxxxxxxx>
- Date: 25 Dec 2005 05:32:04 -0800
enrio@xxxxxxxxx 寫道:
> sorcerer skrev:
> >From what you say it sounds like you will just pass the data on to
> another process, which will be waiting for it, or possibly first
> ensuring somehow that the other process is "ready for it".
>
> But what about using shared memory in the two processes? If the amount
> of data is large, isn't shared memory the fastest? That would be copy
> once - to the shared memory. Or rather, generate once - in the shared
> memory?
The amount of real data is large but the amount of the auxiliary
data is small.
The auxiliary data includes the information abount the size of the
real data and
the production time of the real data . The producer process only
reads the real
data from some hardware, put the real data in the shared memory,
and generates
the auxiliary data, and then send the auxiliary data to the consumer
processes
which are ready for it.
Yes, the real data is generated once (in a shared ring buffer).
The auxiliary data
isn't. Yes, I can put the auxiliary data into another ring buffer too.
By this way, consumer
processes only reads the latest auxiliary data from some sort of shared
index.
>
> Then what more you need is synchronization. What about using a futex?
Yes. However, we use kernel 2.4. :(
> You mean you doubt it is free of bugs? (I fail to see how being "no
> linux VMM expert" helps avoiding bugs.) Or did I miss something?
Yes. I doubt it is free of bugs.
>
> > I did not take the
> > reference of ptrace.c while I implemented that.
>
> Sorry, what do you mean?
/usr/src/linux/kernel/ptrace.c uses get_user_pages as some sort of
memory copy.
I should take that as a reference when I implemented memory copy
between processes.
Sorry for my poor english and thanks for your suggestions. :)
.
- Follow-Ups:
- Re: Want to know something about mlock or shmctl via SHMLOCK
- From: Enrique Perez-Terron
- Re: Want to know something about mlock or shmctl via SHMLOCK
- References:
- Want to know something about mlock or shmctl via SHMLOCK
- From: sorcerer
- Re: Want to know something about mlock or shmctl via SHMLOCK
- From: sorcerer
- Re: Want to know something about mlock or shmctl via SHMLOCK
- From: enrio
- Want to know something about mlock or shmctl via SHMLOCK
- Prev by Date: Re: Want to know something about mlock or shmctl via SHMLOCK
- Next by Date: Re: How to intercept a sys call.
- Previous by thread: Re: Want to know something about mlock or shmctl via SHMLOCK
- Next by thread: Re: Want to know something about mlock or shmctl via SHMLOCK
- Index(es):