Questions tagged [safe-publication]

42 questions
0
votes
0 answers

Logical Replication Structure Change History Sync

Lately I am using PostgreSQL for replicating some data from multiple databases to a single database. For testing the Logical Replication I have created a simple example transferring data from one database to another only for a single table. The idea…
0
votes
0 answers

PostgreSQL Logical Replication Skip LSN of previous iteration

Lately I am using PostgreSQL for replicating some data from multiple databases to a single database. For testing the Logical Replication I have created a simple example transferring data from one database to another only for a single table. The idea…
0
votes
2 answers

Object Publication and Escape Java concurrency , how does this reference exactly escapes here?

I was recently going through "Java Concurrency in practice" and came across example of Publication and Escape , after going through it several times I still feel that I didn't completely understood the example. public class ThisEscape{ …
Anand Kadhi
  • 1,790
  • 4
  • 27
  • 40
0
votes
0 answers

Visibility of final fields not set in constructor

I've seen a class do something like this class Foo { private final Set set = Collections.synchronizedSet(new HashSet<>)); public void add(Bar b) { set.add(b); } } However, the final set is not initialized in the…
katiex7
  • 863
  • 12
  • 23
0
votes
1 answer

When a form is handled in JSF, does it all happen in one thread?

Say I have this piece of code #{hour.time}
katiex7
  • 863
  • 12
  • 23
0
votes
2 answers

Is calling start() on a object of this class safe? An example from Java Concurrency in practice

First off, I will give links to the source code that I will be talking about since copy/paste would make this question page too long. In Listing 5.15 http://jcip.net/listings/CellularAutomata.java of JCIP, I imagine that in some main method, one…
0
votes
0 answers

Is Concurrency In practice listing 5.15 broken?

In JCIP, listing 5.15, Goetz demonstrates a class using CyclicBarrier, but what intrigued me was that inside of the constructor of the class that uses this barrier, he lets the this reference escape by instantiating a new CyclicBarrier. For other…
0
votes
0 answers

Why SafePoint threadSafe?(concurrency in practice )

I am reading the concurrency in practice. There is following example(4.3.5): @ThreadSafe public class SafePoint { @GuardedBy("this") private int x, y; private SafePoint(int[] a) { this(a[0], a[1]); } public SafePoint(SafePoint p) {…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
0
votes
1 answer

safe publication, argument passing

I have two threads, each has its own counter: thread A has counterA, thread B has counterB. Each thread has to use both counters: thread A has to use counterA and counterB, also thread B has to use both. I am using AtomicInteger and to share the…
Gibezynu Nu
  • 354
  • 6
  • 15
0
votes
0 answers

Constructor publishing itself then throwing exception

In following code snippet, will published object be garbage collected ? Is there any chance that published will stay around as a half constructed object ? final class Publisher { public static volatile Publisher published; public…
Mac
  • 1,711
  • 3
  • 12
  • 26
0
votes
1 answer

How can I tell the difference between source and published .NET code?

How can I tell the difference between source and published .NET code? I am looking at some inherited code that I have not touched in about a year. The original designer had me first publish locally before uploading the published code to the…
xarzu
  • 8,657
  • 40
  • 108
  • 160
-1
votes
1 answer

Are static blocks executed in sequential order? Also what if it isn't a block

Are these lines with static initializers guaranteed to run in order? Because if not then things might go wrong public Class x { private static final BasicDataSource ds = new BasicDataSource(); private static final JdbcTemplate jdbcTemplate =…
katiex7
  • 863
  • 12
  • 23
1 2
3