Hi On Tue, Apr 15, 2008 at 3:10 AM, bhanu nani <bhanu.lnxnew@xxxxxxxxx> wrote: > The write method is: > > static DECLARE_WAIT_QUEUE_HEAD(muk_wait); > static DECLARE_WAIT_QUEUE_HEAD(muk_wr_wait); > wait_queue_t my_wait; /* init_wait(&my_wait) in mod init */ > > ssize_t muk_write(struct file *filp, char const *buff, size_t count, > loff_t *f_pos) > { > prepare_to_wait(&muk_wr_wait, &my_wait, TASK_INTERRUPTIBLE); > schedule(); > finish_wait(&muk_wr_wait, &my_wait); > } > > and the read method is as follows: > ssize_t muk_read(struct file *filp, char *buff, size_t count, loff_t *f_pos) > { > write =FULL; > wake_up_interruptible(&muk_wr_wait); > return 0; > } > > Whats heppens is: > when I call my write first, it blocks up expected at schedule as it > gives the processor way to CPU. > But when I try to get the control back with a wakeup call from read, > it is not able to wake the slepping Write process up. try to use interruptible_sleep_on instead of prepare_to_wait(). http://lxr.linux.no/linux/kernel/sched.c#L3869 regards, Mulyadi. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ