Recommend a good resource for approaches to concurrent programming? [closed]

I recommend An Introduction to Parallel Programming by Pacheco. It’s clearly written, and a good intro to parallel programming. If you don’t care about something being tied to a language, then Java Concurrency in Practice is a great resource. Oracle’s online tutorial is free, but probably a bit more succinct than what you’re looking for. … Read more

Will Cron start a new job if the current job is not complete? [duplicate]

They’ll run at the same time. The standard practice around this is to create a file lock (commonly referred to as a flock), and if the lock isn’t available, don’t run. The advantages to this over Zdenek’s approach is that it doesn’t require a database, and when the process ends, the flock is automatically released. … Read more

Optimistic vs Multi Version Concurrency Control – Differences?

I think they are sometimes used interchangeably, and if the transaction only involves one object then they are essentially the same, but MVCC is an extension of optimistic concurrency (or a version of it) that provides guarantees when more than one object is involved. Say that you have two objects, A and B, which must … Read more

SSE instructions: which CPUs can do atomic 16B memory operations?

In the IntelĀ® 64 and IA-32 Architectures Developer’s Manual: Vol. 3A, which nowadays contains the specifications of the memory ordering white paper you mention, it is said in section 8.1.1 that: The Intel486 processor (and newer processors since) guarantees that the following basic memory operations will always be carried out atomically: Reading or writing a … Read more

List of concurrency models

Actor Model I heard of message passing where there is no memory shared. Is it about Erlang-style Actors? Scala uses this idea in its Actors framework (thus, in Scala its not a part of the language, just a library) and it looks quite sexy! In a few words Actors are objects that have no shared … Read more

What is optimal value for Phusion passenger PassengerMaxRequestQueueSize

Why you should limit queuing Any requests that aren’t immediately handled by an application process, are queued. Queuing is usually is bad: it often means that your server cannot handle the requests quickly enough. A larger queue means that requests are less likely to be dropped. But this comes with a drawback: during busy times, … Read more

Would you explain lock ordering?

In the simple case given, unlocking in the reverse order is not necessary to avoid a deadlock. However, as the code gets more complicated, unlocking in the reverse order helps you maintain proper lock ordering. Consider: A.lock(); B.lock(); Foo(); A.unlock(); Bar(); B.unlock(); If Bar() attempts to reacquire A, you’ve effectively broken your lock ordering. You’re … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)