मनोज वर्मा
864 posts

मनोज वर्मा
@knapsack120
Socially Inept
Barabanki, India Katılım Kasım 2021
320 Takip Edilen16 Takipçiler

and dumb people are thinking that they are getting smarter.
LLMs have a net negative impact.
Paras Chopra@paraschopra
In the age of LLMs, smart people are getting smarter, while dumb people are getting dumber.
English

@chessMan786 How file descriptor table is associated with memory segments of a process ?
English

𝐔𝐬𝐞𝐫 𝐋𝐞𝐯𝐞𝐥 𝐯𝐞𝐫𝐬𝐮𝐬 𝐊𝐞𝐫𝐧𝐞𝐥 𝐌𝐚𝐧𝐚𝐠𝐞𝐝 𝐓𝐡𝐫𝐞𝐚𝐝 𝐏𝐚𝐜𝐤𝐚𝐠𝐞𝐬
Thread management splits between user space and kernel space, shaping how systems handle concurrency.
In a user level threads package, threads run entirely in user space, supported by a library that manages scheduling without kernel intervention. The kernel sees only the process, maintaining a process table and perhaps a thread table indirectly through a run time system.
This keeps operations quick, as creating or switching threads avoids costly system calls. But if a thread blocks, say on I/O, the kernel blocks the whole process, stalling all threads inside it.
Contrast that with a kernel managed threads package, where the kernel directly oversees threads. Here, the thread table resides in kernel space, allowing the OS to schedule individual threads independently.
The process stays in user space, but threads get kernel support for true parallelism, especially on multi core systems. Blocking one thread lets others continue, improving responsiveness. The trade off comes in overhead, since every thread action involves kernel mode switches, which take more time than user level handling.
Developers pick based on needs. User level suits apps with many short lived threads where speed matters over isolation, like in some embedded systems or older libraries.
Kernel managed shines in modern setups requiring robust concurrency, such as servers handling multiple connections. Many OS combine elements, using user level for efficiency and kernel for critical features.
Performance tuning often involves measuring context switch times and blocking frequencies. In user level, custom schedulers can optimize for specific workloads, but lack kernel's global view.
Kernel managed provides fairness across processes but might introduce latency. Tools like profilers help spot bottlenecks in either approach.

English

@chessMan786 Suppose we have cpu with more than one core, then both fork and pthreads can leverage that new core for parallel computing ? Or both use context switching ?
English

@chessMan786 The contiguous nature for stack allocation is due to no optimization? I mean it is not guaranteed right ?
Can I say memory allocation will be contiguous if the variables are inside struct or class ?
Ofcourse array will be contiguous we know that.
English

@OSdev_ Learning this much is enough to be a good multi threaded program developer ?
English

@chessMan786 When fork is needed ? Please mention it's use cases? Is this used for multithreading in c ? Child has it's own memory space ?
Btw thank you
English




















