)
> }
>
> When (3) has observed the value written by (2) there is a happens-before
> edge between (2) and (3). And due to the program order between (1)/(2) and
> (3)/(4) and the transitive nature of happens-before, there is a
> happens-before edge between (1) and (4). So the value&
int x;
volatile int v;
write(x, 1) read(v)
write(v, 1) read(x)
Is that program data race free? On my eye it is not not because there is an
execution that write(x, 1) and read(x) are not in happens-before
relationship.
--
You received this message because you are subscribed t
Thanks!
czw., 15 wrz 2022 o 12:40 Peter Veentjer napisał(a):
>
>
> On Thu, Sep 15, 2022 at 11:43 AM r r wrote:
>
>> What about a such case:
>>
>> AtomicLong x;
>> volatile boolean v;
>>
>> T1:
>>v = true;
means
that T2 observer v == true because of happens-before *(1) -hb-> (2) -hb->
(3)*?
środa, 14 września 2022 o 14:04:16 UTC+2 r r napisał(a):
> Thanks
>
> śr., 14 wrz 2022, 13:26 użytkownik Peter Veentjer
> napisał:
>
>>
>>
>> On Wed, Sep 14, 2022 at 1:51
Thanks
śr., 14 wrz 2022, 13:26 użytkownik Peter Veentjer
napisał:
>
>
> On Wed, Sep 14, 2022 at 1:51 PM r r wrote:
>
>> Hello,
>> let's look for the following piece of code:
>>
>> int x;
>> volatile boolean v; // v = false by default
>&g
Hello,
let's look for the following piece of code:
int x;
volatile boolean v; // v = false by default
T1:
x = 1; (1)
v = true;(2)
doSth(3)
T2:
doSth2(4)
if (v) {} (5)
When T2 observes that v == false in (5), does it mean that ther
t;> e.g.
>>>>> queues)
>>>>>
>>>>> Since the happens-before relation is transitive, there is a
>>>>> happens-before edge between (1) and (4).
>>>>>
>>>>> On Mon, Sep 12, 2022 at 4:02 PM Alper Tekinalp
>
;
>>>> From util.concurrent:
>>>>
>>>> > Actions in a thread prior to placing an object into any concurrent
>>>> collection happen-before actions subsequent to the access or removal of
>>>> that element from the collection in anothe
another thread.
>>
>> So ether one of threads will print (true, true) I guess.
>>
>> On Mon, Sep 12, 2022, 3:42 PM Peter Veentjer
>> wrote:
>>
>>> If T1 would run first, the content of the ConcurrentHashMap is (1,true),
>>> and therefore t
Hello,
let's look for the following piece of code:
c = new ConcurrentHashMap();
T1:
c.put(1, true);
for (Boolean b : c.values()) {
print(b);
}
T2:
c.put(2, true);
for (Boolean b : c.values()) {
print(b);
}
Is it guaranteed by JMM that any thread (T1 or
Thanks, watched it :). It is a great video that makes an overview of JVM /
JIT optimizations. Do you know any material that are more in-depth,
especially for inlining / devirtualization / escape analysis?
piątek, 29 kwietnia 2022 o 16:56:40 UTC+2 Gil Tene napisał(a):
> There are some some reco
Hello,
do you know good resources to learn a bit about JIT compiler in Java?
(Beyond reading JDK sources ;) )
--
You received this message because you are subscribed to the Google Groups
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
:30:38 UTC+1 gregor...@gmail.com napisał(a):
>>
>>> which jvm?
>>>
>>> On Sat, Feb 5, 2022 at 6:26 AM r r wrote:
>>>
>>>> Hello,
>>>> we know that there are some techniques that make virtual calls not so
>>>> expensive in JVM like Inl
Hello,
1. What is the fastest implementation of resizable array in Java? I know
only one, that copies whole array to larger, new allocated array (offheap
or noheap, do not care now).
2. I have one idea to implement (at least on Linux) no-copy, resizable
array by using mremap syscall. Then, only
JVM 11+ (OpenJDK / Zulu)
sobota, 5 lutego 2022 o 12:30:38 UTC+1 gregor...@gmail.com napisał(a):
> which jvm?
>
> On Sat, Feb 5, 2022 at 6:26 AM r r wrote:
>
>> Hello,
>> we know that there are some techniques that make virtual calls not so
>> expensive in JVM li
Hello,
we know that there are some techniques that make virtual calls not so
expensive in JVM like Inline Cache or Polymorphic Inline Cache.
Let's consider the following situation:
Base is an interface.
public void f(Base[] b) {
for(int i = 0; i < b.length; i++) {
b[i].m();
Thanks
czwartek, 29 lipca 2021 o 20:30:46 UTC+2 alarm...@gmail.com napisał(a):
> There is a happens before edge between calling the start method of a
> thread and the thread running.
>
> On JMM level that is sufficient.
>
> On Thu, Jul 29, 2021, 18:47 r r wrote:
>
>&g
Hello,
We have the simple pseudocode:
void main(String[] args) {
MemoryBuffer b = new MemoryBuffer(); // it is a off-heap native piece
of memory allocated by malloc via JNI
b.init(); // it just write some data to the memory buffer by JNI
startThreadsThatReadsFromBuffer(b); // this fu
18 matches
Mail list logo