the peterson algorithm of the package mutex (chapter 2) - the algorithm not complile

263 views
Skip to first unread message

Elisangela Silva

unread,
Apr 17, 2014, 3:29:43 PM4/17/14
to art-of-multiproc...@googlegroups.com
Good Afternoon

I Try execute the code for examples of the book.
for example: the peterson algorithm of the package mutex (chapter 2), but i could not because the compiler error is:
   Class mutex.Peterson doesnot a main method

i need add something in the code, to that  compile
Please, How can I Resolve this?

some idea?

Thanks very much.

Chris Uzdavinis

unread,
Apr 17, 2014, 4:13:22 PM4/17/14
to art-of-multiproc...@googlegroups.com
If the code doesn't have a main function, then it's intended to be used by other
code but not directly executed.  You probably should write your own main function
inside a class in another file, with this signature:

class Whatever
{
  public static void main(String args[])
  {
  }
}

Then have this main function make use of the code you're trying to test.

Chris


--
You received this message because you are subscribed to the Google Groups "Art of Multiprocessor Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to art-of-multiprocessor-...@googlegroups.com.
To post to this group, send email to art-of-multiproc...@googlegroups.com.
Visit this group at http://groups.google.com/group/art-of-multiprocessor-programming.
For more options, visit https://groups.google.com/d/optout.

Elisangela Silva

unread,
Apr 18, 2014, 6:26:49 AM4/18/14
to art-of-multiproc...@googlegroups.com
Yeah, ok i will try here

Thanks


Em quinta-feira, 17 de abril de 2014 17h13min22s UTC-3, cuzdav escreveu:
If the code doesn't have a main function, then it's intended to be used by other
code but not directly executed.  You probably should write your own main function
inside a class in another file, with this signature:

class Whatever
{
  public static void main(String args[])
  {
  }
}

Then have this main function make use of the code you're trying to test.

Chris
On Thu, Apr 17, 2014 at 2:29 PM, Elisangela Silva <silva...@gmail.com> wrote:
Good Afternoon

I Try execute the code for examples of the book.
for example: the peterson algorithm of the package mutex (chapter 2), but i could not because the compiler error is:
   Class mutex.Peterson doesnot a main method

i need add something in the code, to that  compile
Please, How can I Resolve this?

some idea?

Thanks very much.

--
You received this message because you are subscribed to the Google Groups "Art of Multiprocessor Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to art-of-multiprocessor-programming+unsubscribe@googlegroups.com.
To post to this group, send email to art-of-multiprocessor-progr...@googlegroups.com.

Semyon Chernyy

unread,
Apr 17, 2014, 7:30:46 PM4/17/14
to art-of-multiproc...@googlegroups.com
I would advise to read Java Introduction first

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Art of Multiprocessor Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to art-of-multiprocessor-...@googlegroups.com.
To post to this group, send email to art-of-multiproc...@googlegroups.com.

Elisangela Silva

unread,
Apr 19, 2014, 1:56:06 PM4/19/14
to art-of-multiproc...@googlegroups.com
sorry but I program in java, is that I got some time without program (inactive)...
I already programmed very in java , :-) 

Problem resolved, :)

Elisangela Silva

unread,
Apr 19, 2014, 1:56:39 PM4/19/14
to art-of-multiproc...@googlegroups.com
sorry but I program in java, is that I got some time without program (inactive)...
I already programmed very in java , :-) 

Problem resolved, :)


Em quinta-feira, 17 de abril de 2014 16h29min43s UTC-3, Elisangela Silva escreveu:
Reply all
Reply to author
Forward
0 new messages