LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-28-2007, 01:57 AM   #1
ashok449
Member
 
Registered: Sep 2007
Location: noida
Distribution: suse
Posts: 63

Rep: Reputation: 16
spinlock example programs


Hi All,
I am looking for some spinlock example programs, Can u people provide me some good links/material on it.



Thanks...
 
Old 07-28-2008, 10:28 PM   #2
lrios
Member
 
Registered: Mar 2008
Location: Arg
Distribution: Cent0S
Posts: 48

Rep: Reputation: 15
Why u do that? In which context do you preferred? Do you like shemaphores or spinlocks

For example in kernel 2.6 implements spinlocks are

spinlock_t my_lock = SPIN_LOCK_UNLOCKED;

Before entering a critical section, your code must obtain the requisite lock with:
void spin_lock(spinlock_t *lock);
There are actually four functions that can lock a spinlock:
void spin_lock(spinlock_t *lock);
void spin_lock_irqsave(spinlock_t *lock, unsigned long flags);
void spin_lock_irq(spinlock_t *lock);
void spin_lock_bh(spinlock_t *lock)
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's a spinlock? TheLateJC Programming 3 05-18-2007 09:19 AM
Spinlock Recursion wahming Linux - General 2 02-15-2007 02:44 AM
spinlock error culin Linux - Hardware 1 09-28-2006 12:29 AM
spinlock <-> IRQ Problem ruhl22 Programming 1 10-05-2004 09:35 AM
'Spinlock' error when running xmms, mplayer coindood *BSD 1 09-27-2004 10:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 04:23 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