I'm trying to create a persistent SQL (SQL Server 2005) lock on a table level. I'm not updating/querying the specified table, but I need to prevent a third party application from updating the locked table as a means to prevent transactions from being posted (the table I wish to lock is the key on their transaction that interferes with my…
Hello,
I'm developing an ASP.NET forms webapplication using C#. I have a method which creates a new Order for a customer. It looks similar to this;
private string CreateOrder(string userName) {
// Fetch current order
Order order = FetchOrder(userName);
if (order.OrderId == 0) {
// Has no order…
Hi guys,
I would like to know whether is there an option to detect locked tables in mysql or no. I mean locked by LOCK TABLE table WRITE/READ command ?
cheers,
Marcin
I intend to perform opening for reading a single file from many threads using std::ifstream. My concern is if std::ifstream is thread-safe & lock-free?
I am looking for a well-tested, publicly available C/C++ implementation of a lock free queue.
I need at least multiple-producers/single-consumer functionality. Multiple-consumers is even better, if exists.
I'm targetting VC's _Interlocked... intrinsics, though anything which is straight forward to port would be fine.
…
I have got an in memory data structure that is read by multiple threads and written by only one thread. Currently I am using a critical section to make this access threadsafe. Unfortunately this has the effect of blocking readers even though only another reader is accessing it.
There are two options to remedy this:
…
We are going to have to stop using lock statements one day. Just like we had to stop using goto statements. The problem is similar, they're pretty easy to follow in small programs, but code with locks isn't composable. That means that small pieces of program that work in isolation can't necessarily be put together and…
Hi,
i need a locking in memcache. Since all operations are atomic that should be an easy task. My idea is to use a basic spin-lock mechanism. So every object that needs locking in memcache gets a lock object, which will be polled for access.
// pseudo code
// try to get a lock
int lock;
do
{
lock =…
This is probably a rudimentary question, but I'm new to threaded programming in Python and am not entirely sure what the correct practice is.
Should I be creating a single lock object (either globally or being passed around) and using that everywhere that I need to do locking? Or, should I be…
If I have 2 synchronized methods in the same class, but each accessing different variables, can 2 threads access those 2 methods at the same time? Does the lock occur on the object, or does it get as specific as the variables inside the synchronized method?
Example:
class x{
private int a;
…
Like gnome Control + alt + L
In Lxde how can i do that? What I have to intall to do this?
thanks
--searching for a solution on my own but...
ok if I do alt+f2 and type xscreensaver-command -lock that's a small solution. tryed to do
an small script but it's not working..
this is what I do
…
I had to reinstall the entire OS a little while ago and I have been trying to reinstall all of the programs I had before but I got a bit a of a problem now. I was trying to download dropbox from synaptic but it cannot finish the process and as a result I cannot update anything anymore. The line…
I am adding a simple web-interface to show data from a commercial off the shelf (COTS) application. This COTS issues locks on any record the user is actively looking at (whether they intend to edit and update it or not).
I have found sp_lock and the Microsoft sp_lock2 scripts and can see…
In this paper: Lock-Free Data Structures (pdf) the following "Compare and Swap" fundamental is shown:
template <class T>
bool CAS(T* addr, T exp, T val)
{
if (*addr == exp)
{
*addr = val;
return true;
}
return false;
}
And then says
The entire procedure is atomic…
Using locks to implement a thread-safe collection is rather like using a sledgehammer - unsubtle, easy to understand, and tends to make any other tool redundant. Unlike the previous two collections I looked at, ConcurrentStack and ConcurrentQueue, ConcurrentDictionary uses locks quite…
I do freelance IT consulting for various clients, both in Toronto, Canada, and worldwide.
A client recently experienced a power failure. Now they've been having various problems with a Slackware 12.0.0 machine which also acts as a DNS server.
One problem is that they can't log into…
This has got to be an easy, trivial question but as a new Mac user, how can I lock my Mac when I walk away?
On Windows this is dead simple - Win+L. Or hit Ctrl-Alt-Del and select "Lock this Computer"
The best thing I've found for the Mac is to rig the screensaver to require password…
Hello,
i have the following mysql table:
myTable:
id int auto_increment
voucher int not null
id_user int null
I've populated voucher field with values from 1 to 100000 so i've got 100000 records; when a user clicks a button in a PHP page, i need to allocate a record for the user…
We have a C#(2.0) application which talks to our server(in java) via web services.
Lately we have started seeing following behavior in (ONLY)one of our lab machines(XP):
Once in a while(every few days), one of the webservice request will just get stuck, will not return or timeout.
…
Herlihy and Shavit's book (The Art of Multiprocessor Programming) solution to memory reclamation uses Java's AtomicStampedReference<T>;.
To write one in C++ for the x86_64 I imagine requires at least a 12 byte swap operation - 8 for a 64bit pointer and 4 for the int.
Is…
Hello I am looking for personalized screen locker for android phones, instead of typing numbers , user can flex fingers in a particular pattern and unlock the screen.
Any pointers/ideas are appreciated.