synchronization Questions

5

Solved

I have a JSON file populated with strings data in Documents Directory. In user Interface of application there is a UIButton. On button press, a new string appends into the JSON file. Now I am look...
Elanorelapid asked 1/8, 2016 at 14:10

2

I have trouble understanding the implementation of a monitor in terms of semaphores from Operating System Concepts 5.8.3 Implementing a Monitor Using Semaphores We now consider a possible imp...

1

Solved

I read sync.Pool design, but find it is two logic, why we need localPool to solve lock compete. We can just use chan to implement one. Using channel is 4x times faster than sync.pool! Besides poo...
Mercie asked 14/6, 2018 at 7:1

1

Solved

I'm trying to send http requests sequently by adding time.Sleep inside goroutine by myself. However, there's always lost one of the response by sync.WaitGroup, for example, this following go clien...
Installment asked 11/6, 2018 at 9:18

8

Solved

I have an ArrayList that I want to use to hold RaceCar objects that extend the Thread class as soon as they are finished executing. A class, called Race, handles this ArrayList using a callback met...
Latialatices asked 14/3, 2010 at 22:18

8

The book Operating System Principles by Silberschatz, Galvin and Gagne contains the following definition for the TestAndSet() instruction in the chapter on synchronization: boolean TestAndSet(bool...
Altman asked 20/7, 2009 at 8:10

2

I attended an interview and I was asked to design a class for the following requirement. Assume I have a class A and it can have any number of children, i.e., subclasses. The class A has a method c...
Kiely asked 26/5, 2018 at 17:55

5

I use Eclipse. When I have an application like this: write 20 times 'Hello World\n' to stdout write 'ERROR\n' to stderr write 5 times 'Hello World\n' to stdout The output looks many times like t...
Chenopod asked 24/5, 2010 at 12:22

4

Making every object lockable looks like a design mistake: You add extra cost for every object created, even though you'll actually use it only in a tiny fraction of the objects. Lock usage become...
Contravention asked 29/8, 2012 at 19:3

4

Solved

I'm having trouble finding the differences between data synchronization and replication. From what I can tell, replication is making all data between 2 databases the same. Synchronization doesn't ...

2

Using XCode-8.2.1, Swift-3.0.2 and iOS-10.2.1, I am trying to call two different URLSession.shared.dataTasks (the first is a simple URL-request and the second is a POST-request). Since my first d...

0

I am thinking of using Keycloak to handle authentication & authorisation of my application. So all the details of roles & users will be stored in keycloak. But I also need to have Users in ...

7

in Java whenever we need to call wait/notify/notifyAll, we need to have access to object monitor (either through synchronized method or through synchronized block). So my question is why java didn'...
Hartley asked 11/8, 2011 at 1:9

2

I really am stumped - I've spent almost two hours searching for an answer to a ridiculously simple question: how can I continually keep two local files in sync on my mac? I investigated various tri...
Exterritorial asked 13/3, 2014 at 10:21

3

Solved

I've a program that goes something like this public class Test implements Runnable { public int local_counter public static int global_counter // Barrier waits for as many threads as we launch ...

6

Solved

As far as I know, java.util.Hashtable synchronizes each and every method in the java.util.Map interface, while Collections.synchronizedMap(hash_map) returns a wrapper object containing synchronized...
Panto asked 16/1, 2012 at 4:10

5

Our company uses Redmine to track tech support issues, but sometimes these issues are escalated to the outsourced development team, who has their own Redmine. Has anyone ever found/written a sync ...
Gabfest asked 27/5, 2011 at 20:5

1

Solved

After upgrading to Android Studio 3.0 gradle snyc fails with the following error messages: Unable to resolve dependency for ':Skynavigator@debug/compileClasspath': Could not resolve project :...
Retinoscope asked 9/4, 2018 at 10:22

1

Solved

The FUSE API doesn't expose a file-system level sync call, just fsync and fsyncdir. Does it mean that when sync is called (or syncfs inside a FUSE mountpoint), the kernel invokes fsync on all open ...
Perversion asked 31/8, 2015 at 13:16

5

Solved

I am planing to implement an app and I have come to a point where I don't know what is the best approach. Scenario: I have an app where I am making a todo list and I am adding 3 items. I use my p...
Mantel asked 16/7, 2013 at 20:31

1

I want to send a $http.get if the page gets closed. Then I stumbold upon a problem where promises can't get resolved because if this one last method returns, the page gets destroyed. The following...

1

Solved

I need to build an application that does these things (in order): on load: 01- connect to MongoDB 'db' 02- creates a collection 'cas' 03- check if a web page has updates, if yes go to step 04, ...
Affable asked 21/3, 2018 at 14:7

0

I am developing an application which is used by multiple clients and the main goal of the app is to be used online. But a specific requirement is, it should be able to work offline too (only for a ...

1

Solved

I am trying to understand inter-thread communication in Java, and read that the support comes by using: wait(), notify(), notifyAll() methods. In order thread to execute any of these methods, the...
Haiphong asked 13/2, 2018 at 12:37

1

Solved

I am using pysftp library's get_r function (https://pysftp.readthedocs.io/en/release_0.2.9/pysftp.html#pysftp.Connection.get_r) to get a local copy of a directory structure from sftp server. Is th...
Caducous asked 23/11, 2017 at 15:39

© 2022 - 2024 — McMap. All rights reserved.