Search:

Type: Posts; User: beer-in-box

Search: Search took 0.19 seconds.

  1. Replies
    18
    Views
    2,377

    [SOLVED] Re: Threads - I need some explanations

    lol. Now you said it, I am not sure either :) I think I meant if this is one of the proper ways of implementing the multithreading concept.

    I see I used the same method as you did with your code...
  2. Replies
    18
    Views
    2,377

    [SOLVED] Re: Threads - I need some explanations

    I meant the starting thread.
    Do the real world applications start the thread as I started? I mean like;

    private Thread t3 = new Thread(new Runnable(){
    @Override
    public void run() {...
  3. Replies
    18
    Views
    2,377

    [SOLVED] Re: Threads - I need some explanations

    Like this? Look how I created t3 thread please.
    I had to make them static, because I run them in the main method which is static.


    public class ClassOne implements Runnable {
    static ClassOne...
  4. Replies
    18
    Views
    2,377

    [SOLVED] Re: Threads - I need some explanations

    I asked the question wrong. So you gave me an answer which is obvious to me. Here is my problem:

    I have one run() method per one class. But I have three other methods in every class.
    I need this:...
  5. Replies
    18
    Views
    2,377

    [SOLVED] Re: Threads - I need some explanations

    And that is where my real struggle starts. How do I make these two run from different threads?
  6. Replies
    18
    Views
    2,377

    [SOLVED] Re: Threads - I need some explanations

    OK, here is my output (I put currentMillis thing to outside of the for loops).

    t1 will start. 1362667052439
    t1 started, t2 will. 1362667052439
    t2 started, someMethod someMethod will.
    And no...
  7. Replies
    18
    Views
    2,377

    [SOLVED] Re: Threads - I need some explanations

    That was quick :)

    Yes, I am asking about these two. I actually don't have any problems with how and when run() methods are called.

    In my mind, when I try to implement multithreading, I think...
  8. Replies
    18
    Views
    2,377

    [SOLVED] Re: Threads - I need some explanations

    Yes, and I think I did it by Thread.sleep(500). But look at the output. "Class two angry method" did not run until the "Class One some method" stopped.
    So, how do I do that?
  9. Replies
    18
    Views
    2,377

    [SOLVED] Re: Threads - I need some explanations

    I don't understand...
    You are saying that a thread doesn't only run the run() method.

    I edited my previous code to put something to show. They all print their class and method names. I had to...
  10. Replies
    18
    Views
    2,377

    [SOLVED] Threads - I need some explanations

    Hey,
    Recently I am trying to comprehend the multithreading concept. I was actually able to build a small app for the purpose. A class was GUI, a class was calculating Hailstone sequence and sending...
Results 1 to 10 of 10