How many threads can YOUR kernel handle?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
molux
Posts: 15
Joined: Fri May 16, 2008 8:36 am

Post by molux »

Hello,

milyges, it's just a short of memory check or what yours thread do ?
Does they do a short of synchronisation ? (other than screen ?)

thanks

Molux
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: How many threads can YOUR kernel handle?

Post by Craze Frog »

I wanted to test this with my kernel to see if everything worked correctly.

With 32mb, the thread count was 6847 (total for two processes).
Image

With 512mb it surprised me by choking as early as 49146 threads, at least there was a proper error message:
Image
molux
Posts: 15
Joined: Fri May 16, 2008 8:36 am

Re: How many threads can YOUR kernel handle?

Post by molux »

Hy sir,

Can you tell us what your thread do ?
Is they a kind of synchronisation ?

Molux
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: How many threads can YOUR kernel handle?

Post by Craze Frog »

They just sleep.
User avatar
AndrewAPrice
Member
Member
Posts: 2306
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: How many threads can YOUR kernel handle?

Post by AndrewAPrice »

I can't really tell at the current stage of my kernel. Eventually it cannot allocate a struct/stackspace/etc and malloc will fail, the error will be passed to server\log (which might not happen since I need to allocate a message packet :( (I could create a pipe between server<->log just for that which requires no allocating).

server\log will create a window (which involves allocate MORE memory!! But let's assume there is enough already in the process's memory that it doesn't have to request for another page) and send a message to "server\window manager" (which requires allocating a message packet, though I could also use another pipe here).

But at it's current state it just causes the system to lock up. In theory the way it's designed the kernel and processes will still be running, new processes/threads can't be spawned, attempts to request the kernel for more memory will fail, and all IPC except for already estabilished pipes and shared memory will not work, UNTIL a process or thread either dies or releases a page back to memory when everything should start working again.

I should add a panic function that drops my kernel back to a text based message, but at this stage my kernel hasn't crashed for a while (it's a microkernel and all it does is handle IPC and processes - which have been around a year and a half now since I touched that code) :)

This thread has made me thinking. As a safeguard I should always keep memory reserved in my kernel and critical servers to use if this condition arises, somehow a panic mode asking the user what threads they should close.
My OS is Perception.
Post Reply