Re:Bug, bug... who's got the bug?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re:Bug, bug... who's got the bug?

Martin Lafaix

> From: [hidden email]
>       -- stop the threads
>       System.out.println('Stopping the threads...')
>       Thread_a.stop()
>       Thread_b.stop()

stop is a very brutal method (and is deprecated in 1.2).  If the
stopped thread was holding a lock, it usually leads to unintended
program behavior.  Could be what you are experiencing here :-)


Martin
--
[hidden email]
Team OS/2
http://www.mygale.org/~lafaix

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: Bug, bug... who's got the bug?

mcbrides
>
>> From: [hidden email]
>>       -- stop the threads
>>       System.out.println('Stopping the threads...')
>>       Thread_a.stop()
>>       Thread_b.stop()
>
>stop is a very brutal method (and is deprecated in 1.2).  If the
>stopped thread was holding a lock, it usually leads to unintended
>program behavior.  Could be what you are experiencing here :-)
>

Hmmm... Working in 1.1.7 and it looks as though my choice of killing a thread
is limited to stop() or destroy(). What is the prefered method in 1.2 if stop()
if deprecated?

Thanks for the post.

--

/--------------------\
| Jerry McBride      |
| [hidden email] |
\--------------------/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: Bug, bug... who's got the bug?

Martin Lafaix
In reply to this post by Martin Lafaix

> From: [hidden email]
> Hmmm...  Working in 1.1.7 and it looks as though my choice of
> killing a thread is limited to stop() or destroy().  What is the
> prefered method in 1.2 if stop() if deprecated?

As in real life.  You politely ask the thread to terminate :-)

More seriously, you use something like:

  -- in your thread class

  foo = Thread

  method run
    foo = this
    loop while foo == this
      -- whatever
    end

  method pleaseRestOhYouMagnificentThread
    foo = null


  -- in your calling code

  ...
  threadA.pleaseRestOhYouMagnificentThread


For more info on thread changes, you can read the Java Tutorial
relevant section:

<URL:http://java.sun.com/docs/books/tutorial/post1.0/preview/threads.html>

[BTW, I'm not stating the bug you have is caused by you calling
 the stop method.  I'm just saying using it leads to problems.]

[BTW2, the Java Tutorial above contains many interesting things
 and examples for Swing.  The examples are in Java, but it
 nonetheless is interesting.]


Martin
--
[hidden email]
Team OS/2
http://www.multimania.com/lafaix

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: Bug, bug... who's got the bug?

dIon Gillard/Multitask Consulting/AU
In reply to this post by Martin Lafaix
                                                             
                                                             
                                                             
  To:          "Martin Lafaix" <[hidden email]>              
                                                             
  cc:          "Netrexx Mailing List"                        
               <[hidden email]>(bcc: dIon        
               Gillard/Multitask Consulting/AU)              
                                                             
                                                             
                                                             
  Subject      Re: Bug, bug... who's got the bug?            
  :                                                          
                                                             










>
>> From: [hidden email]
>>       -- stop the threads
>>       System.out.println('Stopping the threads...')
>>       Thread_a.stop()
>>       Thread_b.stop()
>
>stop is a very brutal method (and is deprecated in 1.2).  If the
>stopped thread was holding a lock, it usually leads to unintended
>program behavior.  Could be what you are experiencing here :-)
>

Hmmm... Working in 1.1.7 and it looks as though my choice of killing a
thread
is limited to stop() or destroy(). What is the prefered method in 1.2 if
stop()
if deprecated?




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>