Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39588 > unrolled thread

Re: Peterson's Algorithm in java, sequencial instruction execution ?

Started bydipanseshagiri@gmail.com
First post2020-07-28 00:23 -0700
Last post2020-10-10 14:57 +0100
Articles 4 — 3 participants

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Peterson's Algorithm in java, sequencial instruction execution ? dipanseshagiri@gmail.com - 2020-07-28 00:23 -0700
    Re: Peterson's Algorithm in java, sequencial instruction execution ? Graeme Geldenhuys <graemeg@example.net> - 2020-10-09 23:51 +0100
      Re: Peterson's Algorithm in java, sequencial instruction execution ? Richard Damon <Richard@Damon-Family.org> - 2020-10-09 20:18 -0400
        Re: Peterson's Algorithm in java, sequencial instruction execution ? Graeme Geldenhuys <graemeg@example.net> - 2020-10-10 14:57 +0100

#39588 — Re: Peterson's Algorithm in java, sequencial instruction execution ?

Fromdipanseshagiri@gmail.com
Date2020-07-28 00:23 -0700
SubjectRe: Peterson's Algorithm in java, sequencial instruction execution ?
Message-ID<33d9c429-bf65-4dca-aaaa-cd65ffdbbc95o@googlegroups.com>
On Saturday, November 25, 2006 at 9:08:06 AM UTC+8, Lawrence wrote:
> Hello guys,
> 
> I have to implement the Peterson's algorithm in java.
> For who of you which is not aware about it, is a low level concurrency
> solution for two threads
> that want to use a shared resource.
> The algorithm use three variables, two flags (booleans) and a turn
> indicator (usually implemented as an int, but possibly a boolean would
> work as well).
> 
> More information about the algorithm here :
> http://en.wikipedia.org/wiki/Peterson's_algorithm
> 
> Now, is really easy to implement it and in theory I won't need to use
> any synchronization
> construct available in java (such as synchronized keyword) since the
> shared memory should be enough.
> 
> Here comes my problem : I learned that some hardware system don't
> necessarily execute the instructions
> in a FIFO order, such as, they don't execute necessarily instructions
> in the same order as they are written in the source code (and then
> compiled) to improve efficency.
> All this in a standard sequencial program (not concurrent).
> Such hardware, to support concurrency, has special "atomic" instrucion
> such as test & set.
> 
> What about the jvm ?
> Because if this is the case (such as execution of the instructions not
> in a sequencial way), the instructions in my program could be executed
> in an order that is not the one I wrote it that will eventually result
> in an invalid state of the program.
> 
> Thank you for any information.

Hello from 2020!
Not sure if this will reach you, but just wanted to say that this whole thread discussion is helping me out in one of my assignments 14 years down the road! :D

[toc] | [next] | [standalone]


#39620

FromGraeme Geldenhuys <graemeg@example.net>
Date2020-10-09 23:51 +0100
Message-ID<rlqpi2$nop$1@gioia.aioe.org>
In reply to#39588
Hi,

On 28/07/2020 8:23 am, dipanseshagiri@gmail.com wrote:
> Hello from 2020! Not sure if this will reach you, but just wanted
> to say that this whole thread discussion is helping me out in one
> of my assignments 14 years down the road! :D

I'm not the original poster, but am curious while news server you
are using that still has message from to long ago. I'm using a
pretty rubbish one where messages expire in something like 14 days.
Makes reading long discussions or past thread impossible. :-/
I'm hoping to find a better news feed.

Regards,
  Graeme

[toc] | [prev] | [next] | [standalone]


#39621

FromRichard Damon <Richard@Damon-Family.org>
Date2020-10-09 20:18 -0400
Message-ID<P57gH.590976$eN2.90244@fx47.iad>
In reply to#39620
On 10/9/20 6:51 PM, Graeme Geldenhuys wrote:
> Hi,
> 
> On 28/07/2020 8:23 am, dipanseshagiri@gmail.com wrote:
>> Hello from 2020! Not sure if this will reach you, but just wanted
>> to say that this whole thread discussion is helping me out in one
>> of my assignments 14 years down the road! :D
> 
> I'm not the original poster, but am curious while news server you
> are using that still has message from to long ago. I'm using a
> pretty rubbish one where messages expire in something like 14 days.
> Makes reading long discussions or past thread impossible. :-/
> I'm hoping to find a better news feed.
> 
> Regards,
>   Graeme
> 
> 

GoogleGroups, not that I would suggest them as a 'good newsfeed', but
Google did buy the DejaNews archive, and it probably is the best source
if you want to look into historical Usenet.

Seems to be problematical to use for posting, as it sounds like the
interface is awful.

[toc] | [prev] | [next] | [standalone]


#39624

FromGraeme Geldenhuys <graemeg@example.net>
Date2020-10-10 14:57 +0100
Message-ID<rlsek8$1p71$1@gioia.aioe.org>
In reply to#39621
On 10/10/2020 1:18 am, Richard Damon wrote:
> GoogleGroups, not that I would suggest them as a 'good newsfeed', 

Thanks Richard. I totally forgot about Google Groups. I used to use
it years back. At least now I'll be able to search some older
topics.

Regards,
  Graeme

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web