[Kde-games-devel] KHighscore locking mechanism

Nicolas Hadacek hadacek at kde.org
Mon May 5 16:39:33 CEST 2003


Hi all,

I am currently trying to solve the problems of using global (for a computer) 
config files for saving highscores. Some basic mechanism is already in place 
in KHighscore but a big (potential) problem is race condition between games 
played by several users at the time when updating the highscores lists.

So I propose a locking mechanism (see the patch against khighscore.h/cpp and a 
separate kfilelock.h/cpp which could be used in other parts of KDE). These 
changes are untested but I just want to have some opinions :)

The second step is to use the locking in KExtHighscore which should be quite 
easy (I have made the changes at home) since support for multiple user is 
there (but basically untested).

The third step is to provide some upgrade path from highscore list per user to 
a global highscore list... I can do that later :)

Flames, praises, comments, ... welcome !

see you,
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: highscores.diff
Type: text/x-diff
Size: 6075 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20030505/81a69aa1/highscores.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kfilelock.cpp
Type: text/x-c++src
Size: 1870 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20030505/81a69aa1/kfilelock.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kfilelock.h
Type: text/x-chdr
Size: 505 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20030505/81a69aa1/kfilelock-0001.bin


More information about the kde-games-devel mailing list