Questions tagged [locking]

Locking allows different types of resources to be used exclusively by one process at a time.

0
votes
0answers
7 views

Lock and Isolation for resource reservation pattern

I need to solve a resource reservation pattern with Spring and MariaDB.The problem is very simple, I have a guest table where I store guest names of events, I have to be sure that the guest count for ...
0
votes
0answers
10 views

Android Kiosk Mode For multiple apps

I wish to develop an app in Android with Kiosk Mode. When the app launches it will ask me for a group of apps installed in the device and then set that app into the only app that can be used. How can ...
0
votes
0answers
19 views

Databricks Spark-Redshift: Hanging when mode is 'overwrite', writing df out to Redshift

using this as the initial command ...PYSPARK_DRIVER_PYTHON=/opt/miniconda/bin/python nohup spark-submit --deploy-mode client --packages com.databricks:spark-redshift_2.10:3.0.0-preview1 --jars ...
0
votes
0answers
16 views

Prevent MS Word mail merge from MS Access query from locking the file

I have an MS Word document for a mail merge, and I want it to use a particular MS Access form to pull the data from a query. However this locks the file, which is a problem because it's also the file ...
0
votes
0answers
9 views

using a commited yarn.lock between different repositories

From this question I learned it's useful and best practice to commit your yarn.lock. Now it's putted in the git repository.Now our problem. Our team A is using the public maven repositories while ...
0
votes
0answers
13 views

Is it possible that windows continue using old file content (exe, dll or data) even if it was replaced in file system

In our home-grown installer I try solve problem with updating files locked by another processes. If locked file detected(say it is MyService.exe locked by Windows Event log service), then it renamed(...
0
votes
0answers
19 views

Why no locked <0x00000006cf5fadc0> information in thread dump?

We met a problem which makes sever hang, we did a thread dump and found there are around 200+ threads with following information:waiting to lock <0x00000006cf5fadc0>"Keep-Alive-Timer" #32300 ...
0
votes
0answers
26 views

What should be the synchronization mechanism to use inside unlocked_ioctl()?

I have seen many unlocked_ioctl() functions from kernel code are not using any data synchronization (mutex, semaphore etc.) at all. Some of them use mutex_lock() which is not sleep-able, but as I ...
0
votes
1answer
35 views

double check locking on HashMap - thread safe?

Is the following code thread safe? The class SlidingTimeWindowCountGauge is already thread safe. The question is around the double check locking code + the regular non-concurrent hashmap.I would ...
0
votes
1answer
22 views

Reentrant Read Write lock on particular value

My application gets lot of incoming HTTP request. In header of each request, there's a key value pair. Say Header1=App1The value App1 keeps on changing. So next it can be App2,App3 and like ...
0
votes
0answers
11 views

How can we hold or lock incoming request and execute after some processing, C# WebApplication

My current requirement is to hold incoming requests and release them when some file export completes. There is a static method which reads an XML file and is based on a key which returns a value....
1
vote
1answer
35 views

Spring Data lock table to read while writing

I am using Spring data in my app (2.0.1). The app is REST-based service which add orders.The order entity looks as follows:@Entity@Table(name="orders")@Data@NoArgsConstructorpublic class ...
1
vote
1answer
31 views

Python: Lock directory

AFAIK this code can be used to lock a directory:class LockDirectory(object):def __init__(self, directory):assert os.path.exists(directory)self.directory=directorydef ...
0
votes
0answers
23 views

Ruby: Maximum Waiting time for pessimistic lock?

Two different systems/process try to update same request. However, I am using pessimistic locking mechanism: lock!. Suppose system-1 acquire the lock before system-2.What is maximum waiting time for ...
0
votes
1answer
54 views

C# thread safety: can reading variable in one thread WHILE updating that variable in another lead to unexpected behavior?

Take this program as an example:class Program{public static double myVar1=0;public static double myVar2=0;static void Main(){Thread thread1=new Thread(new ThreadStart(...
0
votes
0answers
6 views

Python import hook to duplicate PYD before importing

I have a large amount of .pyd modules that are ran of a network, my problem is that when they are used, they are file locked and i can't overwrite them. So I'm looking into having an import hook that ...
-6
votes
0answers
24 views

Lock and unlock computer using python script. [closed]

I need to lock and unlock a windows system using python code. I can Lock as well as unlock but I am unable to enter the password from code. I tried using tscon.exe but getting "access denied" error ...
0
votes
1answer
22 views

Peewee row level blocking

I'm currently using Peewee as an ORM in my project. In my current situation, I have some processes each having a database connection. All of these processes need to access a certain table ...
2
votes
0answers
33 views

How to correctly instantiate a static HttpClient in constructor

I have a custom HttpClient implementation that needs some values from my configuration to work properly.public class MyHttpClient : HttpClient{public MyHttpClient(){}public ...
1
vote
0answers
32 views

rt_mutex_lock and mutex_lock in linux

I have read about rt_mutex_lock, which has priority inheritance for waiters. Apart from this what is difference between rt_mutex and mutex in Linux? In which case should we use rt_mutex_lock?
1
vote
1answer
61 views

Preventing race condition during multiple concurrent requests in Asp.Net MVC and EF

I have one controller method which creates new order in database with incremental custom order id (i.e. ABC000005)Order table has below fieldsId (PK)NameCustomOrderIdDateTimeTo implement that ...
1
vote
1answer
72 views

Can you specialize std::unique_lock

A mutex we use has a strange interface (weird casing for example). Having a specialization for std::unique_lock would help reduce the cognitive overhead of using this mutex. I couldn't find anything ...
3
votes
1answer
26 views

Launch a new JVM in a unit test

I've got a class, which is locking files. (See below.) Now, I've got a unit test, which asserts the successful locking between two threads in the same VM. However, I'd actually have the locks working ...
1
vote
1answer
19 views

Bow/Bower example in java oracle tutorial with lock object

In the java docs example, the lock.unlock() method is used twice, once in impendingBow() method and bow() method. My question is, shouldn't lock.unlock() method in impendingBow() method do the trick, ...
-2
votes
0answers
19 views

When does spring jpa/hibernate save changes?

I would like to understand 2 different scenarios where an entity is stored automatically vs stored manuallyExample 1 (Objects gets stored automatically after the 2nd findById)@Transactional public ...
-2
votes
0answers
16 views

How to lock my source code remotely in my java servlet application?

How to lock my source code remotely in my java servlet application? I have a uni project and i want to share it with someone for a little time but after that i want to lock it and make him not access ...
0
votes
0answers
11 views

global locks preventing the rest of my code from executing despite no other threads

def addUser_InHash(username, password, clearanceLvl):print("Adding user in hash")hashID=0hashString=username + passwordhashIncIndex=0 # This is used to increment "...
0
votes
0answers
37 views

How does locking work in case of locking a structure and a field in a structure?

Consider a structure: struct ns_server {unsigned int magic;isc_mem_t * mctx;ns_interfacemgr * interfacemgr;isc_task_t * task;...
0
votes
1answer
41 views

Ruby: Right way to do optimistic locking?

Context: Product is getting updated by multiple threads. So it leads the race condition. So I am using optimistic locking because it is frequently not updated. For latest update state of the product ...
0
votes
0answers
26 views

Android Lollipin implementation

When I launch this app it doesn't ask for a pin code and there are no errors reported either.What am I doing wrong?public class StartUI extends AppCompatActivityimplements EasyPermissions....

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,