LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-15-2004, 07:10 AM   #1
zdscmnbc
LQ Newbie
 
Registered: Dec 2004
Location: gz.cn
Distribution: red hat
Posts: 2

Rep: Reputation: 0
in_atomic


In kernel 2.6.8 file -- include/linux/hardirq:
Suppose kernel with SMP.

#define in_atomic ((preempt_count()&~PREEMPT_ACTIVE) != kernel_locked())

Qeustion1:
Why can this definition represent the atomic operation?
In my opinion,in_atomic is defined like this:
#define in_atomic ((preempt_count() &~PREEMPT_ACTIVE) ||kernel_locked()

Question2:
What's meaning of task_struct::lock_depth?

Qeustion3:
Additionally,can current task release CPU when lock_depth>=0?
 
Old 12-15-2004, 07:43 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
these are questions about programming the linux kernel, and have no relation to Local Linux user meetings or other social events. please pick a more suitable forum to post in next time. thanks
 
Old 12-15-2004, 07:54 AM   #3
zdscmnbc
LQ Newbie
 
Registered: Dec 2004
Location: gz.cn
Distribution: red hat
Posts: 2

Original Poster
Rep: Reputation: 0
I'm wrong....

Thank you for reminding me.
I just successully register in LUG,and post an unrelated quetion.Please delete it.
Sorry.....
 
Old 12-15-2004, 10:29 AM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
This thread is more appropriate in Programming and has now been moved to that forum.
 
  


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 Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:52 PM.

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