Jump to content
  • entries
    2
  • comments
    5
  • views
    1,007

About this blog

Moving the inferno out of my mod thread.

Entries in this blog

Fair spinlock in papyrus

This is a little snippet of code, that I've written in C and C++ before. This time it's for papyrus.   It's a ticket-based spinlock. For those with a comp-sci background, known as a ticket lock (Communicating Sequential Processes - C.A.R.Hoare, Chapter 6.6 Scheduling).   So what does it offer: it's a spinlock (i.e. a form of mutex) it's fair (the thread that waits the longest for the lock is the one that will acquire it next).   It provides 3 functions: Function lock() locks the

irquih

irquih

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use