Skip to contentSkip to conversation

how to use wait_event_interruptible_timeout

DISCUSSION manomugdha biswas 2 participants 5 messages Sep 13, 2005

lore
Share & tools
lore
#0 lore raw

Hi,
I was using interruptible_sleep_on_timeout() in kernel 2.4. In kernel 2.6 I have use wait_event_interruptible_timeout. But it is now working!!. interruptible_sleep_on_timeout() was working fine. Could anyone please help me in this regard.
Regards,
Mano

Manomugdha Biswas

__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

#1 lore raw
Quoted 7 lines · manomugdha biswas

Hi,
I was using interruptible_sleep_on_timeout() in kernel 2.4. In kernel 2.6 I have use wait_event_interruptible_timeout. But it is now working!!. interruptible_sleep_on_timeout() was working fine. Could anyone please help me in this regard.

What problem are you facing with wait_event_interruptible_timeout() in 2.6 Elaborate more on it.

-Gaurav

Quoted 15 lines

Regards,
Mano

Manomugdha Biswas

__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 3 lines
- Gaurav
my blog: http://lkdp.blogspot.com/
--
#2 lore raw

Hi,
I am using the this function in the following way:

wait_queue_head_t VNICClientWQHead;

/* Initialise the wait q head */
init_waitqueue_head(&VNICClientWQHead);

init_waitqueue_entry(&waitQ, current); add_wait_queue(sock->sk->sk_sleep, waitQ));

/*
my code, it reads data from socket
*/

wait_event_interruptible_timeout(VNICClientWQHead, 0, HZ * 100000);

if no activity is to be done then this process sleeps. When some data comes in socket i.e socket becomes readable this process should wake up. In kernel 2.4 it was working fine using interruptible_sleep_on_time(). But it is not working in kernel 2.6 even if data arrives in socket! The sleeping process never wake up. Could you please tell me what is the problem?

Regards,
Mano

Quoted 11 lines · --- Gaurav Dhiman
Quoted 2 lines · manomugdha biswas

Hi,
I was using interruptible_sleep_on_timeout() in

kernel

Quoted 5 lines

2.4. In kernel 2.6 I have use
wait_event_interruptible_timeout. But it is now
working!!. interruptible_sleep_on_timeout() was
working fine. Could anyone please help me in this
regard.

Quoted 15 lines

What problem are you facing with
wait_event_interruptible_timeout() in 2.6
Elaborate more on it.

-Gaurav

Quoted 8 lines

Regards,
Mano

Manomugdha Biswas

__________________________________________________________

Quoted 24 lines
Quoted 1 line

Yahoo! India Matrimony: Find your partner now. Go

to http://yahoo.shaadi.com

Quoted 2 lines

-
To unsubscribe from this list: send the line

"unsubscribe linux-kernel" in

Quoted 2 lines

the body of a message to [email protected] More majordomo info at

http://vger.kernel.org/majordomo-info.html

Quoted 2 lines

Please read the FAQ at http://www.tux.org/lkml/

Signature · 10 lines
- Gaurav
my blog: http://lkdp.blogspot.com/
--
-
To unsubscribe from this list: send the line
"unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at 
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Manomugdha Biswas

__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

#3 lore raw
Quoted 2 lines · manomugdha biswas

Hi,
I am using the this function in the following way:

you are using it wrong way ....

Quoted 8 lines

wait_queue_head_t VNICClientWQHead;

/* Initialise the wait q head */
init_waitqueue_head(&VNICClientWQHead);

init_waitqueue_entry(&waitQ, current); add_wait_queue(sock->sk->sk_sleep, waitQ));

need not to do this at all, as all this is done by wait_event_interruptible_timepout() function. Just here you initialize the head of the list.

Quoted 82 lines

/*
my code, it reads data from socket
*/

wait_event_interruptible_timeout(VNICClientWQHead, 0, HZ * 100000);

if no activity is to be done then this process sleeps. When some data comes in socket i.e socket becomes readable this process should wake up. In kernel 2.4 it was working fine using interruptible_sleep_on_time(). But it is not working in kernel 2.6 even if data arrives in socket! The sleeping process never wake up. Could you please tell me what is the problem?

Regards,
Mano

Quoted 11 lines · --- Gaurav Dhiman
Quoted 2 lines · manomugdha biswas

Hi,
I was using interruptible_sleep_on_timeout() in

kernel

Quoted 5 lines

2.4. In kernel 2.6 I have use
wait_event_interruptible_timeout. But it is now
working!!. interruptible_sleep_on_timeout() was
working fine. Could anyone please help me in this
regard.

Quoted 15 lines

What problem are you facing with
wait_event_interruptible_timeout() in 2.6
Elaborate more on it.

-Gaurav

Quoted 8 lines

Regards,
Mano

Manomugdha Biswas

__________________________________________________________

Quoted 12 lines
Quoted 1 line

Yahoo! India Matrimony: Find your partner now. Go

to http://yahoo.shaadi.com

Quoted 2 lines

-
To unsubscribe from this list: send the line

"unsubscribe linux-kernel" in

Quoted 2 lines

the body of a message to [email protected] More majordomo info at

http://vger.kernel.org/majordomo-info.html

Quoted 2 lines

Please read the FAQ at http://www.tux.org/lkml/

Quoted 12 lines

--
- Gaurav
my blog: http://lkdp.blogspot.com/
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Manomugdha Biswas

__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

Signature · 3 lines
- Gaurav
my blog: http://lkdp.blogspot.com/
--
#4 lore raw

Hi,
I have a kernel module (kernel 2.6) where I have opened multiple tcp connections. when there is no data i want my process to sleep. For that i have added the following code.

/* Initialise the wait q head */
init_waitqueue_head(&VNICClientWQHead);

init_waitqueue_entry(&(currentMap->waitQ), current); add_wait_queue(currentMap->sock->sk->sk_sleep, &(currentMap->waitQ));

/* here currentMap is a structure containing tcp conenction info for my module. There is a currentMap for each tcp connection */

wait_event_interruptible_timeout(VNICClientWQHead,

                                 0, HZ * 100000);

I am not sure about the condition argument, 0.

It is not working. How the condition is to be set here so that whenever data is available on any socket (tcp connection) the sleeping process gets waken up?

Could anyone please give some light on this?

Regards,
Mano

Quoted 53 lines · --- Gaurav Dhiman
Quoted 2 lines · manomugdha biswas

Hi,
I am using the this function in the following way:

you are using it wrong way ....

Quoted 8 lines

wait_queue_head_t VNICClientWQHead;

/* Initialise the wait q head */
init_waitqueue_head(&VNICClientWQHead);

init_waitqueue_entry(&waitQ, current);
add_wait_queue(sock->sk->sk_sleep, waitQ));

need not to do this at all, as all this is done by wait_event_interruptible_timepout() function. Just here you initialize
the head of the list.

Quoted 6 lines

/*
my code, it reads data from socket
*/

wait_event_interruptible_timeout(VNICClientWQHead,

0,

Quoted 3 lines

HZ * 100000);

if no activity is to be done then this process

sleeps.

Quoted 2 lines

When some data comes in socket i.e socket becomes
readable this process should wake up. In kernel

2.4 it

Quoted 1 line

was working fine using

interruptible_sleep_on_time().

Quoted 2 lines

But it is not working in kernel 2.6 even if data arrives in socket! The sleeping process never wake

up.

Quoted 12 lines

Could you please tell me what is the problem?

Regards,
Mano

Quoted 4 lines · --- Gaurav Dhiman
Quoted 2 lines · manomugdha biswas

Hi,
I was using interruptible_sleep_on_timeout()

in

Quoted 27 lines
Quoted 3 lines
Quoted 3 lines

kernel

Quoted 2 lines

2.4. In kernel 2.6 I have use
wait_event_interruptible_timeout. But it is

now

Quoted 1 line
Quoted 1 line
Quoted 1 line

working!!. interruptible_sleep_on_timeout()

was

Quoted 1 line
Quoted 1 line
Quoted 1 line

working fine. Could anyone please help me in

this

Quoted 18 lines
Quoted 17 lines
Quoted 1 line

regard.

What problem are you facing with
wait_event_interruptible_timeout() in 2.6
Elaborate more on it.

-Gaurav

Quoted 8 lines

Regards,
Mano

Manomugdha Biswas

__________________________________________________________

Quoted 23 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

Yahoo! India Matrimony: Find your partner now.

Go

Quoted 5 lines
Quoted 5 lines

to http://yahoo.shaadi.com

Quoted 2 lines

-
To unsubscribe from this list: send the line

"unsubscribe linux-kernel" in

Quoted 1 line

the body of a message to

[email protected]

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

More majordomo info at

http://vger.kernel.org/majordomo-info.html

Quoted 1 line

Please read the FAQ at

http://www.tux.org/lkml/

Quoted 11 lines
Quoted 11 lines
Quoted 1 line

--
- Gaurav
my blog: http://lkdp.blogspot.com/
--
-
To unsubscribe from this list: send the line
"unsubscribe linux-kernel" in
the body of a message to

Quoted 13 lines

[email protected]

Quoted 11 lines
Quoted 4 lines

More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Manomugdha Biswas

__________________________________________________________

Quoted 10 lines
Quoted 1 line

Yahoo! India Matrimony: Find your partner now. Go

to http://yahoo.shaadi.com

Quoted 1 line
Signature · 3 lines
- Gaurav
my blog: http://lkdp.blogspot.com/
--

Manomugdha Biswas

__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com