TLRW-ByteLock : return of the read-write lock -- Transact 2009

TLRW-ByteLock: return of the read-write lock by myself and Nir Shavit will appear in Transact 2009. (Slides).

Comments:

Hi David,

Have you considered the possibility of grouping bytes in byte-array (in byte-lock) based not on lock object, but instead based on slotted thread id. I.e. current layout:

struct byte_lock
{
int owner;
char byte_array [48];
int read_counter;
};

byte_lock g_locks [LOCK_COUNT];

What I am talking about is:

struct byte_lock_part1
{
int owner;
int read_counter;
char unused [48]; // probably still required
};

struct byte_lock_part2
{
char byte_array [LOCK_COUNT];
};

byte_lock_part1 g_locks1 [LOCK_COUNT];
byte_lock_part2 g_locks2 [48]; // actually in this layout 48 can be replaced with arbitrary number

Have you rejected such layout? Or just did not consider? I think provided low write rate such layout may provide some benefits, because readers do not contend for cache-lines.

--
Best regards,
Dmitriy V'jukov

Posted by Dmitriy V'jukov on April 02, 2009 at 08:49 PM EDT #

Dmitriy, you will still have contention over the byte-array across the different readers. I don't think reader-writer contention was a primary focus since the lock is still targeting read-mostly workloads (of course, writer starvation is dealt with by the algorithm itself).

Even if it was, the reader-writer contention will still exist when using the CAS-less variant of the slotted write lock.

Posted by Samy Al Bahra on August 08, 2010 at 01:44 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Dave

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today