Hello Pudila,
Thanks for your answer. How the application knows that kernel has unblocked.
Thanks
Jhoney
On Sun, 06 Mar 2005 Octavian Purdila wrote :
>On Sunday 06 March 2005 07:40 am, jhoney jhoney wrote:
> > Hello All,
> >
> > I am working with kernel programming. I have question. When any application
> > calls a function which is a blocking call, for ex. accept() is a blocking
> > call and the application is going to block until the other host calls
> > connect.
> >
>
>There are a few mechanism that the kernel can use to block a process, but most
>of the time a waiting queue is used to block a process while waiting for an
>event.
>
> > My question is How the application is blocking and how the kernel notifies
> > it after a connect is called by other host in the network.
>
>The blocking is done in the kernel. See the sleep_on/wake_up family of
>functions.
>
> > And also kernel
> > sys_accept is called when application calls accept.How the kernel is
> > executing the sys_accept for another process while blocking on the
> > sys_accept for the first process.
> >
>
>Each process has it's own stack in kernel space, so you can have multiple
>processes executing different kernel paths (if care is taken -- like using
>spinlocks, making functions reentrant).
>
>tavi
>
>--
>Kernelnewbies: Help each other learn about the Linux kernel.
>Archive: http://mail.nl.linux.org/kernelnewbies/
>FAQ: http://kernelnewbies.org/faq/
>