Sr.No. Metodi e descrizione
1

Thread.abort_on_exception

Restituisce lo stato dell'interruzione globale in condizione di eccezione . L'impostazione predefinita è false . Se impostato su true , causerà l'interruzione di tutti i thread (il processo uscirà da (0)) se viene sollevata un'eccezione in qualsiasi thread

2

Thread.abort_on_exception=

Se impostato su true , tutti i thread verranno interrotti se viene sollevata un'eccezione. Restituisce il nuovo stato.

3

Thread.critical

Restituisce lo stato della condizione critica del thread globale .

4

Thread.critical=

Imposta lo stato della condizione critica del thread globale e lo restituisce. Se impostato su true , impedisce la pianificazione di qualsiasi thread esistente. Non blocca la creazione e l'esecuzione di nuovi thread. Alcune operazioni di thread (come l'arresto o l'uccisione di un thread, la sospensione nel thread corrente e la generazione di un'eccezione) possono causare la pianificazione di un thread anche quando si trova in una sezione critica.

5

Thread.current

Restituisce il thread attualmente in esecuzione.

6

Thread.exit

Termina il thread attualmente in esecuzione e pianifica l'esecuzione di un altro thread. Se questo thread è già contrassegnato per essere terminato, exit restituisce il thread. Se questo è il thread principale o l'ultimo thread, uscire dal processo.

7

Thread.fork { block }

Sinonimo di Thread.new.

8

Thread.kill( aThread )

Fa sì che la data un thread per uscire

9

Thread.list

Restituisce un array di oggetti Thread per tutti i thread che possono essere eseguiti o arrestati. Filo.

10

Thread.main

Restituisce il thread principale per il processo.

11

Thread.new( [ arg ]* ) {| args | block }

Crea un nuovo thread per eseguire le istruzioni fornite nel blocco e inizia a eseguirlo. Tutti gli argomenti passati a Thread.new vengono passati al blocco.

12

Thread.pass

Invoca lo scheduler del thread per passare l'esecuzione a un altro thread.

13

Thread.start( [ args ]* ) {| args | block }

Fondamentalmente lo stesso di Thread.new . Tuttavia, se la classe Thread è una sottoclasse, la chiamata di start in quella sottoclasse non richiamerà il metodo di inizializzazione della sottoclasse .

14

Thread.stop

Arresta l'esecuzione del thread corrente, mettendolo in uno stato di sospensione e pianifica l'esecuzione di un altro thread. Reimposta la condizione critica su false.

Sr.No. Metodi e descrizione
1

thr[ aSymbol ]

Attributo di riferimento - Restituisce il valore di una variabile thread-local, utilizzando un simbolo o un aSymbol nome. Se la variabile specificata non esiste, restituisce nil .

2

thr[ aSymbol ] =

Attributo Assignment - Imposta o crea il valore di una variabile locale del thread, utilizzando un simbolo o una stringa.

3

thr.abort_on_exception

Restituisce lo stato di interruzione in condizione di eccezione per thr . L'impostazione predefinita è false .

4

thr.abort_on_exception=

Quando è impostato su true , causa l'interruzione di tutti i thread (incluso il programma principale) se viene sollevata un'eccezione in thr . Il processo uscirà effettivamente (0) .

5

thr.alive?

Returns true if thr is running or sleeping.

6

thr.exit

Terminates thr and schedules another thread to be run. If this thread is already marked to be killed, exit returns the Thread. If this is the main thread, or the last thread, exits the process.

7

thr.join

The calling thread will suspend execution and run thr. Does not return until thr exits. Any threads not joined will be killed when the main program exits.

8

thr.key?

Returns true if the given string (or symbol) exists as a thread-local variable.

9

thr.kill

Synonym for Thread.exit.

10

thr.priority

Returns the priority of thr. Default is zero; higher-priority threads will run before lower priority threads.

11

thr.priority=

Sets the priority of thr to an Integer. Higher-priority threads will run before lower priority threads.

12

thr.raise( anException )

Raises an exception from thr. The caller does not have to be thr.

13

thr.run

Wakes up thr, making it eligible for scheduling. If not in a critical section, then invokes the scheduler.

14

thr.safe_level

Returns the safe level in effect for thr.

15

thr.status

Returns the status of thr: sleep if thr is sleeping or waiting on I/O, run if thr is executing, false if thr terminated normally, and nil if thr terminated with an exception.

16

thr.stop?

Returns true if thr is dead or sleeping.

17

thr.value

Waits for thr to complete via Thread.join and returns its value.

18

thr.wakeup

Marks thr as eligible for scheduling, it may still remain blocked on I/O, however.