David Dice's Weblog

Thursday Feb 12, 2009

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 03, 2009 at 03:49 AM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed
Copyright © 2006-2008 Dave Dice, All Rights Reserved.

Calendar

Feeds

Search

Links

Navigation

Referers

XML Feed
Creative Commons License
This work is licensed under a Creative Commons Attribution-No Derivative Works 3.0 License.