Questions tagged [spinlock]

A spinlock is a lock which causes a thread trying to acquire it to simply wait in a loop ("spin") while repeatedly checking if the lock is available.

318 questions
2
votes
2 answers

APC User-Cache suitable for high load environments?

We try to deploy APC user-cache in a high load environment as local 2nd-tier cache on each server for our central caching service (redis), for caching database queries with rarely changing results, and configuration. We basically looked at what…
ak2
  • 457
  • 1
  • 5
  • 17
2
votes
1 answer

Is there any one who knows to solve OSSpinLockLock issue when I programming a game using SpriteKit iOS7?

OSSpinLockLock was caused repeatedly and lldb reveals no appropriate callStackSymbols for this. The following is what I got from lldb of Xcode Version 5.0.1 (5A2034a) I tried to get more symbols by [NSThread callStackSymbols] but it is not…
Sungwook Kim
  • 356
  • 1
  • 3
  • 11
2
votes
2 answers

custom lock with spinlock

i can not see the error, maybe someone can help me out here. I have a custom lock using spinlock (it's a for school) public class Spinlock : Locker { Boolean locked = false; private SpinLock spinLock = new SpinLock(); public override…
2
votes
0 answers

ARM and Linux spin_lock_irqsave concern

This is my first query in stack exchange so please bear with me. Almost all the questions which come to my mind already got resolved from the forum, but I cannot able to found this one. I have made a simple device driver in Linux where in my_init()…
2
votes
1 answer

C++ - init & destory of mutexes and spin-lock

Is it possible to allocate and init a mutex in one thread and destory it in another? Thanks.
2
votes
2 answers

Is it ok to use spinlocks with O(1) non-memory contiguous code?

I'm using spinlocks (pthread ones) with generally O(1) list element access/removal in the locked code section. I say generally because on 99.9% of cases the code doesn't loop through the list (which might contain 1000+ elements). The code will…
Emanuele
  • 1,408
  • 1
  • 15
  • 39
2
votes
2 answers

Are there any performance penalties for running SMP enabled Linux kernel on a Uni processor (ARM Cortex A8 based SOC)?

This is a two fold question that raised from my trivial observation that I am running a SMP enabled Linux on our ARM-Cortex 8 based SoC. First part is about performance (memory space/CPU time) difference between SMP and NON-SMP Linux kernel on a Uni…
Satpal Parmar
  • 361
  • 3
  • 12
2
votes
1 answer

Spinlocks in IRQ on a small embedded system

I'm developing a small embedded system on an ARM microcontroller WITHOUT AN OPERATING SYSTEM. It has several different types of interrupts occurring (button presses, A to D conversion, timer - etc.) and just a single thread running. I want to have a…
Adrian S
  • 514
  • 7
  • 16
2
votes
1 answer

Using spinlocks with gcc

how can I use pthread_spinlock_t in gcc 4.6.3? Which flags do I have to specify at compile time? I'm using Ubuntu 12.04! Thanks
Emanuele
  • 1,408
  • 1
  • 15
  • 39
2
votes
2 answers

Non-blocking socket accept without spinlock in C

Possible Duplicate: Wake up thread blocked on accept() call I am writing a small server which listening for connections (accepting them and passing them to worker threads) until a custom stop signal is sent. If I use blocking sockets, then my…
Technosites
  • 67
  • 1
  • 6
2
votes
1 answer

Spinlock not working to protect critical section on multi-core system

I have a character device driver which is causing a system deadlock on a multicore system. The write call has a critical section protected by a spin lock (spin_lock_irqsave). The ISR must obtain this lock to finish its task as well. If the ISR is…
2
votes
1 answer

Does raw_spin_lock in Linux disable hrtimer interrupts?

On one processor, in the same thread, first raw_spin_lock() is called, then it starts a hrtimer and goes back to raw_spin_lock() again where it will spin there. In the hrtimer interrupt handler function, raw_spin_unlock() will be called. Will this…
Hao Shen
  • 2,605
  • 3
  • 37
  • 68
2
votes
2 answers

Is there any simple way to improve performance of this spinlock function?

I'm trying to implement a spinlock in my code but the spinlock that I implemented based on Wikipedia results in extremely slow performance. int lockValue = 0; void lock() { __asm__("loop: \n\t" "movl $1, %eax \n\t" "xchg…
Jigglypuff
  • 1,433
  • 6
  • 24
  • 38
2
votes
1 answer

Solving the Spinlock issue

In the Linux Device Drivers. When it introduces spinlocks, it gives the following example: Your driver is executing and has just taken out a lock that controls access to its device. While the lock is held, the device issues an interrupt, which…
foo_l
  • 591
  • 2
  • 10
  • 28
1
vote
3 answers

Spinlock in Javascript

How can I do a spinlock in javascript? I'm trying to load a bunch of images and I can only move forward after everything is loaded, so I have a spinlock like for(...) image[i].onload = function() { ++imagesloaded; } while(imagesloaded !=…
user1032861
  • 487
  • 3
  • 11
  • 19