-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
Currently I have the following class:
public class PluginManager
{
private static bool s_initialized;
private static object s_lock = new object();
public static void Initialize() {
if (!s_initialized) {
lock (s_lock) {
if (!s_initialized)…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Why is locking a type considered very bad?
For example, lock(typeof(DateTime)) I understand that static methods of any class in .net is considered thread safe, and that instance members are not. So it isn't necessary to lock DateTime while you are using it. The book I am reading doesn't explain why…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I still feel a bit unsafe about the topic and hope you folks can help me -
For passing data (configuration or results) between a worker thread polling something and a controlling thread interested in the most recent data, I've ended up using more or less the following pattern repeatedly:
Mutex…
>>> More
-
as seen on Server Fault
- Search for 'Server Fault'
After upgrading PHP from 5.1x to 5.2.10, there are a lot of warning when php -v:
[root@localhost ~]# php -v
PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I want to work with PDO, through PHP command line.
It works perfect through the PHP web API, but not through the command line.
But when I execute the command: php test.php, it says unknown class PDO.
I think it has something to do with the thread-safety difference.
Because, when I execute the above…
>>> More