[Qt-interest] Do QTimer Race Conditions Exist

Thiago Macieira thiago at kde.org
Thu Feb 11 23:30:31 CET 2010


Em Quinta-feira 11. Fevereiro 2010, às 22.30.26, Will Rutherdale (rutherw) 
escreveu:
> There are different versions of actually implementing the timer, but the
> job of allocating the timer id falls to
> QAbstractEventDispatcherPrivate::allocateTimerId().
> 
> This code has an elaborate scheme with buckets whose job is to allocate
> different timer ids.
> 
> It appears that timer ids are kept unique (or pretty close), which was
> my remaining concern.

That's a thread-safe, lock-free ID allocator with ABA-prevention.

See http://labs.trolltech.com/blogs/2008/10/22/a-never-ending-struggle/ for 
more information on how it works and why it's there in the first place.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100211/1a8ae54b/attachment.bin 


More information about the Qt-interest-old mailing list