Safrout's blog

By Safrout, 9 years ago, In English

Is the usage of multiple threads in Java allowed in the ICPC or no??

added after edit {

I know it won't differ in time but there is a powerful feature in Java that I want to know if I can use it or no.

The feature is the ability of changing the size of the memory stack for recursion.

I can set it for threads by this constructor

new Thread(null, new Runnable() {
    public void run() {
        new Solution().run();
    }
}, "1", 1 << 23).start();

Here the 1 << 23 is the new size for the memory Stack.

The whole solution will be written in the Solution().run() method.

So I don't need to do multiple threads and avoid time. I only need to make one single thread

}

Is this possible in the ICPC World Finals or not ?

  • Vote: I like it
  • +8
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I can't find something about it there.

    But I have doubts about it with some people.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Serious test engines measure cpu time, but not astronomical time. Your total running time will be sum of cpu times for all threads plus other costs for using threads. So threads will be not as useful as you planned.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I know it's not useful in time.

    But in Java it gives me other powerful tools by just making one thread.

    I don't care about the time I only care about the allowability of using it.

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can you, please, explain for me and other readers, what features is it?

      • »
        »
        »
        »
        9 years ago, # ^ |
          Vote: I like it +12 Vote: I do not like it

        The feature is changing the size of the memory stack for recursion.

        You can use this in java in your main method

        new Thread(null, new Runnable() {
        public void run() {
        new Solution().run();
        }
        }, "1", 1 << 23).start();
        

        the 1 << 23 is the new size of the memory stack.

        the whole solution will be written in the Solution().run() method.

        So I don't need to do multiple threads and avoid time. I only need to make one single thread.

      • »
        »
        »
        »
        9 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        But I didn't get it.

        Is it allowed in the ICPC finals or not ?

        • »
          »
          »
          »
          »
          9 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I don't know about ICPC final, but as I remember we used it in semifinals and quarterfinals (NEERC).