るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.039秒)
トップページ > クエリ:Integer[x] > クエリ:loop[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer upto
  5. integer new

ライブラリ

クラス

キーワード

検索結果

BasicSocket#getpeereid -> [Integer, Integer] (209.0)

Unix ドメインソケットにおいて接続相手の euid と egid を 返します。

...id です。

ソケットが Unix ドメインソケットでない場合の返り値は
不定です。

require 'socket'

Socket.unix_server_loop("/tmp/sock") {|s|
begin
euid, egid = s.getpeereid

# Check the connected client is myself or not.
next if euid != Proce...

Thread#priority -> Integer (114.0)

スレッドの優先度を返します。この値が大きいほど優先度が高くなります。 メインスレッドのデフォルト値は 0 です。新しく生成されたスレッドは親スレッドの priority を引き継ぎます。

...存します。

//emlist[例][ruby]{
Thread.current.priority # => 0

count1 = count2 = 0
a = Thread.new do
loop
{ count1 += 1 }
end
a.priority = -1

b = Thread.new do
loop
{ count2 += 1 }
end
b.priority = -2
count1 = count2 = 0 # reset
sleep 1 # => 1
count1 # => 13809431...

Enumerator#size -> Integer | Float::INFINITY | nil (108.0)

self の要素数を返します。

...いた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。

//emlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 94109400
loop
.size # => Float::INFINITY
(1..100).drop_while.size # => nil
//}

@see Enumerator.new...

Thread#priority=(val) (14.0)

スレッドの優先度を返します。この値が大きいほど優先度が高くなります。 メインスレッドのデフォルト値は 0 です。新しく生成されたスレッドは親スレッドの priority を引き継ぎます。

...存します。

//emlist[例][ruby]{
Thread.current.priority # => 0

count1 = count2 = 0
a = Thread.new do
loop
{ count1 += 1 }
end
a.priority = -1

b = Thread.new do
loop
{ count2 += 1 }
end
b.priority = -2
count1 = count2 = 0 # reset
sleep 1 # => 1
count1 # => 13809431...