Thursday, 15 July 2010

c - How does N1 threading model work? -



c - How does N<->1 threading model work? -

in continuation question, additional query on n-1 threading model.

it taught that, before designing application, selection of threading model need taken care.

in n-1 threading model, single kernel thread available work on behalf of each user process. os scheduler gives single cpu time piece kernel thread.

in user space, programmer utilize either posix pthread or windows createthread() spawn multiple threads within user process. programmer used posix pthread or windows createthread() kernel aware of user-land threads , each thread considered processor time assignment scheduler. so, means every user thread kernel thread.

my question:

so, how n-1 threading model looks possible exist? 1-1 threading model. please clarify.

in user space, programmer utilize either posix pthread or windows createthread() spawn multiple threads within user process. programmer used posix pthread or windows createthread() kernel aware of user-land threads , each thread considered processor time assignment scheduler. so, means every user thread kernel thread.

that's how 1-to-1 threading works.

this doesn't have case. platform can implement pthread_create, createthread, or whatever other "create thread" function offers whatever wants.

my question:

so, how n-1 threading model looks possible exist? 1-1 threading model. please clarify.

precisely explained in origin of question -- when programmer creates thread, instead of creating thread kernel aware of, creates thread userland scheduler aware of, still using single kernel thread entire process.

c multithreading linux-kernel kernel

No comments:

Post a Comment