Re: [openbeos] Re: GSoC ticket #1069 (thread scheduler) application
Ingo Weinhold <bonefish-CFLBMwTPW48UNGrzBIF7/[email protected]> Thu, 12 Apr 2007 00:53:44 +0200
| Newsgroups | gmane.os.openbeos.kernel.devel |
|---|---|
| Message-ID | <[email protected]> |
On 2007-04-10 at 21:33:28 [+0200], André Braga <[email protected]> wrote: > On 4/10/07, Ingo Weinhold <bonefish-CFLBMwTPW48UNGrzBIF7/[email protected]> wrote: [...] > > IMHO, a GA approach is over the top, as is your > > specialized memory allocator idea. > > GA, definitely. A memory allocator is not that over the top, IMO; it's > all about having a contiguous memory space and putting related memory > objects close together and hopefully bring them into the cache at the > same time. But that's just an optimization -- one that would > potentially save thousands of cycles, may I add --, it's not even > close to being essential. We're planing to have a slab allocator for our kernel anyway. If your stuctures end up being small enough (i.e. smaller than a cache line; in case of per-thread data you'd obviously have to separate them from struct thread then) you can simply use a separate cache, which will result in exactly the locality you're looking for. > > Regarding memory usage, I think it's not that much of an issue. While it's > > generally prudent to have an eye on kernel memory usage, a few bytes more > > in struct thread won't be a problem -- even with thousand threads (a > > rather > > unusual case I'd say) it's only some KB after all. > > You just touched on the question I was intending to ask next... What > is the realistic number of threads expected to be present on a typical > BeOS system? I don't know how typical my system would be, so I guess > I'd better run an informal poll here... I don't think it's usually more than a few hundred threads. I'd be surprised, if I ever managed to have more than 1000 threads at the same time. The hard limit under BeOS is 4096; IMHO completely sufficient. CU, Ingo ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV