LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-21-2005, 11:07 PM   #1
asurya
LQ Newbie
 
Registered: Apr 2005
Posts: 10

Rep: Reputation: 0
kernel thread and blocking calls


Please help me in understanding blocking and non-blocking calls.
I have the following doubts regarding kernel threads and blocking/non-blocking calls.

My understanding regarding blocking and non-blocking calls is as follows:

A blocking call is one which does not return from that call till the call is completely run. On the other hand, a non-blocking is one which returns immediately if it needs to block for some resource.
Is this understanding correct? Please correct me if i am wrong.


Is there any limitation that a kernel thread should call only blocking-calls in its execution. If yes, what will be the issue if a non-blocking call is called from a kernel thread.
 
Old 09-22-2005, 11:15 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
my knowledge is a bit lacking but i will try.
blocking functions is when the calling processes execution is blocked untill the kernel call is completed.
(unless the process recievs a signal)
where the kernel API for a function is non blocking or blocking is the same as asking if the kernel function is implemented using an an asynchronous model or a syncronous model
i think if at all possible the kernel should have everything it can execute asynchronously and certainly a lot of things can be done that way
it is even possible for the kernel internally to be doing a little spinning while the API appears to the user space program to be non blocking or asynchronous.

for instance read() may be important to execute syncronously because you figure the user space program wants to process the read information but write() you can execute asynchronously for better performance to a certain extent as long as you don't think critical data will be lost or whatever other concerns are.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding system calls to the kernel yakul Programming 1 11-19-2005 09:38 PM
kernel thread yhus Programming 2 08-04-2005 04:30 PM
obtain pid of a kernel thread ratwings Linux - Software 0 02-11-2005 03:54 PM
Kernel 2.4.26, slack 8.0: blocking outgoing traffic coindood Linux - Networking 3 06-03-2004 10:15 PM
kernel module method calls acid_kewpie Programming 6 03-13-2002 02:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration