PHP'ers:
Ben Ramsey
Brandon Savage
Cal Evans
Chris Shiflett
Eli White
Elizabeth Naramore
Joe LeBlanc
Justin Thorp
Mike Naberezny
Rasmus Lerdorf
Tony Bibbs
Zend Blogs
Zend DevZone
DC Social Media:
Aaron Brazell
Geoff Livingston
Jessie X
Ken Yeung
New Media Jim
Shashi B
Social Times
Technologists:
Jimmy Gardner
O'Reilly Radar
Scott Berkun
Steve McConnell
Business/mISV:
Bob Walsh
Eric Sink
Gavin Bowman
Guy Kawasaki
Joel Spolsky
Micah Baldwin
Paul Graham
Planet mISV
Past Projects:
CodeSnipers
HOBY
Judicial Watch
mobile Fox Affiliates
mobile FoxNews.com
MyDearJohnLetter
NRTW
techRepublican
Great Tools I use:
BaseCamp
Drupal
getClicky
Highrise
phpUnit
Qcodo
Subversion
web2Project
Zend Framework
This is not the home of dotProject. It is the home of CaseySoftware, LLC. Any dotProject support questions should be referred to their support forums.
thread safety
Hi Keith,
Just a quick comment about your singleton code; there's a potential thread safety issue. In your code:
public static function getInstance() {
if (self::$instance === null) {
self::$instance = new Singleton();
}
return self::$instance;
}
It's possible that thread calls :
if (self::$instance === null)
then gets interrupted and thread 2 calls the same code and passes. Then they both execute:
self::$instance = new Singleton();
This could be a big issue depending on what your singleton is constructing...
I would rather recommend that you do:
private static $instance = new Singleton();
This way it's done before any of the methods can be called, and only once as the static instance is created.
Just my little tip from having been tripped up by the singleton.
Regards,
Steph