Re: Question regarding spinlock

2009-05-19 Thread Shyam Burkule
All, On Tue, May 19, 2009 at 3:33 AM, raz ben yehuda razi...@gmail.com wrote: On Tue, 2009-05-19 at 00:49 +0700, Mulyadi Santosa wrote: On Tue, May 19, 2009 at 12:33 AM, Ole Loots o...@monochrom.net wrote: Hello to the list, I got a question about spinlocks. Here is some

Re: Question regarding spinlock

2009-05-19 Thread Mulyadi Santosa
Hi... Sorry if my earlier post confused some people. What I wanted to say was actually that spinlock is SMP safe, however, in multicore it makes code running on a cpu might spin to wait for other code running on different cpu. so, to avoid this, perhaps the original poster could gain better

Re: Question regarding spinlock

2009-05-19 Thread Shyam Burkule
On Tue, May 19, 2009 at 10:52 PM, Mulyadi Santosa mulyadi.sant...@gmail.com wrote: Hi... Sorry if my earlier post confused some people. What I wanted to say was actually that spinlock is SMP safe, however, in multicore it makes code running on a cpu might spin to wait for other code running

Re: Question regarding spinlock

2009-05-19 Thread Peter Teoh
On Tue, May 19, 2009 at 1:33 AM, Ole Loots o...@monochrom.net wrote: Hello to the list, I got a question about spinlocks. Here is some pseudo-code: my_external_int_handler(...) {   spin_lock(my_lock);   // do things...   spin_unlock(my_lock); } my_ioctl_handler(ioctl_value) {  

Question regarding spinlock

2009-05-18 Thread Ole Loots
Hello to the list, I got a question about spinlocks. Here is some pseudo-code: my_external_int_handler(...) { spin_lock(my_lock); // do things... spin_unlock(my_lock); } my_ioctl_handler(ioctl_value) { switch(ioctl_value) { case xy: spin_lock_irqsave(my_lock,

Re: Question regarding spinlock

2009-05-18 Thread Mulyadi Santosa
On Tue, May 19, 2009 at 12:33 AM, Ole Loots o...@monochrom.net wrote: Hello to the list, I got a question about spinlocks. Here is some pseudo-code: my_external_int_handler(...) {   spin_lock(my_lock);   // do things...   spin_unlock(my_lock); } my_ioctl_handler(ioctl_value) {  

Re: Question regarding spinlock

2009-05-18 Thread raz ben yehuda
On Tue, 2009-05-19 at 00:49 +0700, Mulyadi Santosa wrote: On Tue, May 19, 2009 at 12:33 AM, Ole Loots o...@monochrom.net wrote: Hello to the list, I got a question about spinlocks. Here is some pseudo-code: my_external_int_handler(...) { spin_lock(my_lock); // do things...

Re: Question regarding spinlock

2009-05-18 Thread Pei Lin
In my opinion,i think spin lock is used for shot-time lock,if you lock long term, cpu will miss the interrupts, i also have the question about when we disable local interrupts,can the interrupt be delivered to other cpus in SMP system? BRs, Lin 2009/5/19 raz ben yehuda razi...@gmail.com: On

Re: Question regarding spinlock

2009-05-18 Thread Kalpesh Rathod
On Tue, May 19, 2009 at 8:49 AM, Pei Lin telent...@gmail.com wrote: In my opinion,i think spin lock is used for shot-time lock,if you lock long term, cpu will miss the interrupts, i also have the question about when we disable local interrupts,can the interrupt be delivered to other cpus in