public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* question about code from the linux kernel development ( se ) book
@ 2005-10-21 11:22 Yitzchak Eidus
  2005-10-21 13:03 ` Steven Rostedt
  0 siblings, 1 reply; 8+ messages in thread
From: Yitzchak Eidus @ 2005-10-21 11:22 UTC (permalink / raw)
  To: linux-kernel

first i am very sorry if it isnt the place to ask questions like this
but i didnt know where else to ask ( i tryed irc channels and i was
send from there to this list )
anyway:
does this following code look buggy? :
DECLARE_WAITQUEUE ( wait , current );
add_wait_queue ( q , &wait );
while ( !condition ) {
set_current_stat ( TASK_INTERRUPTABLE ); i
if ( signal_pending ( current ) )
/* handle signal */
schedule ( ); }
set_current_state ( TASK_RUNNING );
remove_wait_queue ( q , &wait );
first:doesnt in the way from checking the !condition to
set_current_state  the condition can be changed no?

second:why not putting the schedule ( ); right after the
set_current_state ( ) , what the point in checking the if (
signal_pending ( ) first, if the proccess doesnt started to sleep yet?
third: in the cleaning in the way from putting the set_current_state (
TASK_RUNNING ) into remove_wait_queue , cant the queue wait list ( q )
wake up again the wait procsess?
( thnks for the help , please if it can be done answer quickly i am
tanker in the idf and need to come back to the army soon , ( no
internet there... ) )
thnks!

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: question about code from the linux kernel development ( se )  book
@ 2005-10-21 14:00 Nick Warne
  2005-10-21 15:56 ` Steven Rostedt
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Warne @ 2005-10-21 14:00 UTC (permalink / raw)
  To: Yitzchak Eidus; +Cc: linux-kernel

Steven Rostedt wrote:

>> ( thnks for the help , please if it can be done answer quickly i am
>> tanker in the idf and need to come back to the army soon , ( no
>> internet there... ) )
> 
> BTW, this is not an IRC, we use normal capitalization and normal spelling
> (when we know how to spell a word ;-).  So the next time you send to the
> list, send it as if you were writing a serious letter, or you may just be
> ignored. (as you might have been if I didn't respond).

Well, I am a real newbie to Linux coding, but I think the guy tried to do 
right (irc sent him here) - maybe I am not used to the terseness of Kernel 
hackers in their replies sometimes.


Yitzchak: I have the book - by Robert Love.  I see the same code (page 53), 
but, alas I haven't a clue...

My advice is drop a mail to Robert about it - he _is_ the author, and I am 
sure he will answer your query.

Nick
-- 
http://sourceforge.net/projects/quake2plus

"Person who say it cannot be done should not interrupt person doing it."
-Chinese Proverb


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-10-21 18:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-21 11:22 question about code from the linux kernel development ( se ) book Yitzchak Eidus
2005-10-21 13:03 ` Steven Rostedt
2005-10-21 13:10   ` Jesper Juhl
2005-10-21 14:41   ` Yitzchak Eidus
2005-10-21 15:07     ` Steven Rostedt
2005-10-21 18:36   ` Lee Revell
  -- strict thread matches above, loose matches on Subject: below --
2005-10-21 14:00 Nick Warne
2005-10-21 15:56 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox