Logo
Distributed Genetic Programming Framework
print print

File org.sfc.parallel.Parallel.java

Here you can find all the information about the file org.sfc.parallel.Parallel.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2005 Thomas Weise
 * 
 * E-Mail           : tweise@gmx.de
 * Creation Date    : 2005-07-05 10:26:38
 * Original Filename: org.sfc.parallel.Parallel.java
 * Version          : 2.0.1
 * Last modification: 2006-03-07
 * Last modified by : Thomas Weise
 * 
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *                    
 * Warranty         : This software is provided "as is" without any
 *                    warranty; without even the implied warranty of
 *                    merchantability or fitness for a particular purpose.
 *                    See the Gnu Lesser General Public License for more
 *                    details.
 */

 
package org.sfc.parallel;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * This class comes with some helping routines  
 *
 * @author Thomas Weise
 */

public final  class Parallel
  {  
/**
 * Create a new read-write lock.
 * @return A new read-write lock-instance.
 */

  public static final ReadWriteLock create_read_write_lock  ()
    {
    return new ReentrantReadWriteLock();
    }
  
  
/**
 * Creates a new lock.
 * @return  The new <code>Lock</code>-instance.
 */

  public static  final Lock  create_lock ()
    {
    return new ReentrantLock();
    }
  
  
/**
 * Wait the specific amount of time without being disturbed by exceptions.
 * @param p_time  The milliseconds to wait.
 * @see Thread#sleep(long)
 */

  public  static  final void  delay (final long p_time)
    {
    try
      {
      Thread.sleep(p_time);
      }
    catch(Throwable l_t)
      {
      //
      }
    }
  
/**
 * Returns the identifier of the current Thread. The thread ID is a
 * positive <code>long</code> number generated when this thread was created.  
 * The thread ID is unique and remains unchanged during its lifetime.  
 * When a thread is terminated, this thread ID may be reused.
 *
 * @return The current thread's ID.
 */

  public  static  final long  get_thread_id ()
    {
    return Thread.currentThread().getId();
    }
  
  }

File Information:

file name:Parallel.java
package:org.sfc.parallel
qualified name:org.sfc.parallel.Parallel.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/sfc/parallel/Parallel.java
size:2.598 KB (2661 B)
uploaded: 2015-07-22 04:11:12 GMT+0000
last update: 2006-03-07 04:19:29 GMT+0000
last access: 2018-01-24 01:34:27 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2018-01-24 01:34:27 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo