Re: kernel hangs quickly - non-root user reproducible
- From: phil-news-nospam@xxxxxxxx
- Date: 17 Jul 2008 19:34:27 GMT
On Thu, 17 Jul 2008 19:08:42 +0200 H.Janssen <henny@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
| Dear Phil,
|
| phil-news-nospam@xxxxxxxx wrote:
|
|> I'm still not clear on what you are referring to. I do know that the
|> kernel supports "copy on write" where a page can be "shared in usage" as
|> long as the
|> processes sharing it don't modify/write it. This different than "shared
|> in content" where changes made by one process are immediately visible to
|> the
|> other process(es). In the "shared in usage" case, when one process writes
|> (or tries to write) on the page, the kernel makes a copy so the other
|> process
|> continues to see the original. In the case of files mapped in by more
|> than one process, this can be done by allowing a process to write, but
|> making sure that the page tables are updated so that the "in RAM" copy is
|> now exclusive
|> to the process that modified it. Other processes get a fresh copy by
|> means
|> of paging in a new copy from the original file. Otherwise I guess the
|> means to do that involves blocking the writes at the page table level and
|> when a process tries to write, make a copy right then if a backing store
|> one is not available.
|>
|
| Thanks for your extensive answer. This is exactly the kernel componet I
| mean. You can safely fork a process, and the kernel takes care of
| having the data "virtually" separate in parent and child without needless
| allocating memory and copying of data. I'm not an expert in programming, do
| not know how this is handled in case of threads, but I'm afraid you have to
| supply your own memory manager. (or take it from a clever library??)
Sharing mapped content between different virtual memory processes that could
make private changes has to be handled by the kernel. Sharing content within
the same virtual memory process between threads is a user space management
issue. Actually the sharing is easy ... keeping threads from stomping on each
other is the hard part. For example, each has to have its own private stack
range within the same address space. And that mean reserving address _space_
(not actually used pages, yet) for each stack as big as might possibly be used
by any thread. What threads really need is syncronization so there are not
any cases of 2 threads stomping on data they try to share (try even the simple
case of 2 threads incrementing a shared counter). That's a big part of what
a clever library is needed for with threads. FYI, I've done non-thread based
programming with no library present at all, in Linux. It was not any harder
than much of the assembly programming I used to do ages ago on IBM mainframes.
--
|WARNING: Due to extreme spam, googlegroups.com is blocked. Due to ignorance |
| by the abuse department, bellsouth.net is blocked. If you post to |
| Usenet from these places, find another Usenet provider ASAP. |
| Phil Howard KA9WGN (email for humans: first name in lower case at ipal.net) |
.
- References:
- kernel hangs quickly - non-root user reproducible
- From: phil-news-nospam
- Re: kernel hangs quickly - non-root user reproducible
- From: phil-news-nospam
- Re: kernel hangs quickly - non-root user reproducible
- From: H.Janssen
- Re: kernel hangs quickly - non-root user reproducible
- From: phil-news-nospam
- Re: kernel hangs quickly - non-root user reproducible
- From: H.Janssen
- Re: kernel hangs quickly - non-root user reproducible
- From: Rainer Weikusat
- Re: kernel hangs quickly - non-root user reproducible
- From: H.Janssen
- Re: kernel hangs quickly - non-root user reproducible
- From: phil-news-nospam
- Re: kernel hangs quickly - non-root user reproducible
- From: H.Janssen
- Re: kernel hangs quickly - non-root user reproducible
- From: phil-news-nospam
- Re: kernel hangs quickly - non-root user reproducible
- From: H.Janssen
- kernel hangs quickly - non-root user reproducible
- Prev by Date: Re: kernel hangs quickly - non-root user reproducible
- Next by Date: powerpc 83xx kernel image boot sequence
- Previous by thread: Re: kernel hangs quickly - non-root user reproducible
- Next by thread: Re: kernel hangs quickly - non-root user reproducible
- Index(es):
Relevant Pages
|