Re: Question regarding spinlock

2009-05-19 Thread Peter Teoh
On Tue, May 19, 2009 at 1:33 AM, Ole Loots 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) > { >   switch(i

Re: Question regarding spinlock

2009-05-19 Thread Ole Loots
Mulyadi Santosa schrieb: 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 pos

Re: Question regarding spinlock

2009-05-19 Thread Shyam Burkule
On Tue, May 19, 2009 at 10:52 PM, Mulyadi Santosa 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 on > different cpu.

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 scala

Re: Question regarding spinlock

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

Re: Question regarding spinlock

2009-05-18 Thread Kalpesh Rathod
On Tue, May 19, 2009 at 8:49 AM, Pei Lin 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 SMP system? Yes, w

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 : > > On Tue, 2009-05-19 a

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 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 Mulyadi Santosa
On Tue, May 19, 2009 at 12:33 AM, Ole Loots 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) > { >   switch(

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,