lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Halácsy Péter <halacsy.pe...@axelero.com>
Subject RE: IndexReader Pool
Date Fri, 12 Jul 2002 14:38:54 GMT
hoops! you are right! i was on holiday last week but I can check the code on the weekend.

peter

> -----Original Message-----
> From: Ilya Khandamirov [mailto:ikh@startext.de]
> Sent: Monday, July 08, 2002 6:00 PM
> To: 'Lucene Users List'
> Subject: RE: IndexReader Pool
> 
> 
> Hi Scott,
> 
> I get deadlocks with the following test code:
> 
> File indDir = new File( "C:\\index" );
> for ( int i = 0; i < 49; i++ )
> {
>   IndexReader reader = IndexAccessControl.getReader( indDir );
>   Thread t = new Thread()
>   {
>     public void run()
>     {
>       File indDir = new File( "C:\\index" );
>       try
>       {
>         IndexWriter writer = IndexAccessControl.getWriter( indDir );
>         IndexAccessControl.releaseWriter( indDir, writer );
>       }
>       catch ( IOException e )
>       {
>         e.printStackTrace();
>       }
>     }
>   };
>   t.start();
>   System.out.println( i );
>   IndexAccessControl.releaseReader( indDir, reader );
> }
> 
> 
> To avoid that i decided to synchronize (and wait/notify) only on sync.
> Since that it looks like it works correctly. What do you think?
> 
> 
> Regards,
> Ilya
> 
> 
> 
> -----Original Message-----
> From: Scott Ganyo [mailto:scott.ganyo@eTapestry.com] 
> Sent: Montag, 8. Juli 2002 16:28
> To: 'Lucene Users List'
> Subject: RE: IndexReader Pool
> 
> 
> Deadlocks could be created if the order in which locks are obtained is
> not consistent.  Note, though, that the locks are obtained in the same
> order each time throughout.  (BTW: The inner lock is merely needed
> because the wait/notify calls need to own the monitor.)
> 
> Naturally, you are free to make any suggestions for improvement! :)
> 
> Scott
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:lucene-user-help@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message