るりまサーチ

最速Rubyリファレンスマニュアル検索!
103件ヒット [1-100件を表示] (0.026秒)
トップページ > クエリ:start[x] > クエリ:signal[x]

別のキーワード

  1. smtp start
  2. net/smtp start
  3. http start
  4. pop start
  5. pop3 start

検索結果

<< 1 2 > >>

Thread::ConditionVariable#signal -> self (18119.0)

状態変数を待っているスレッドを1つ再開します。再開された スレッドは Thread::ConditionVariable#wait で指定した mutex のロックを試みます。

...ConditionVariable.new
flg = true

3.times {
Thread.start {
mutex.synchronize {
puts "a1"
while (flg)
cv.wait(mutex)
end
puts "a2"
}
}
}

Thread.start {
mutex.synchronize {
flg = false
cv.signal
}
}

sleep 1

# => a1
# => a1
# => a1
# => a2
//}...

Open3.#pipeline_start(*cmds) -> [Thread] (6114.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。

...
ドの配列を返します。

例:

require "open3"

# xeyesを10秒だけ実行する。
Open3.pipeline_start("xeyes") {|ts|
sleep 10
t = ts[0]
Process.kill("TERM", t.pid)
p t.value #=> #<Process::Status: pid 911 SIGTERM (signal 15)>
}

@see Open3.#popen3...

Open3.#pipeline_start(*cmds) {|wait_thrs| ... } -> () (6114.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。

...
ドの配列を返します。

例:

require "open3"

# xeyesを10秒だけ実行する。
Open3.pipeline_start("xeyes") {|ts|
sleep 10
t = ts[0]
Process.kill("TERM", t.pid)
p t.value #=> #<Process::Status: pid 911 SIGTERM (signal 15)>
}

@see Open3.#popen3...

Thread::ConditionVariable (36.0)

スレッドの同期機構の一つである状態変数を実現するクラスです。

...において条件が満たされたなら signal
メソッドでスレッド a に対して条件が成立したことを通知します。これが典型的な
使用例です。

mutex = Mutex.new
cv = ConditionVariable.new

a = Thread.start {
mutex.synchronize {
.....
...ない)
cv.wait(mutex)
end
...
}
}

b = Thread.start {
mutex.synchronize {
# 上の条件を満たすための操作
cv.signal
}
}

以下は 14445 で紹介されている例です。@q が空になった場合...
...@full.wait(@mutex) if count == @max
@q.push v
@empty.signal if count == 1
}
end

def deq
@mutex.synchronize{
@empty.wait(@mutex) if count == 0
v = @q.shift
@full.signal if count == (@max - 1)
v
}
end

alias send enq...

ruby 1.8.4 feature (18.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...0

: シグナル [bug]

#Sun Oct 16 03:38:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * rubysig.h (CHECK_INTS): prevent signal handler to run during
# critical section. [ruby-core:04039]

シグナルハンドラの実行はクリティカルセクション...
...:19 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
#
# * lib/webrick/cgi.rb (WEBrick::CGI#start): req.query_string should
# refer the value of QUERY_STRING. [ruby-list:41186]

WEBrick::CGI#startでreq.query_stringがオリジナルの
QUERY_STRINGを指すように。

: WEBrick::H...

絞り込み条件を変える

Monitor (12.0)

スレッドの同期機構としてのモニター機能を提供するクラスです。 また同じスレッドから何度も lock できる Mutex としての機能も提供します。

..._cond = mon.new_cond

# consumer
Thread.start do
loop do
mon.synchronize do
empty_cond.wait_while { buf.empty? }
print buf.shift
end
end
end

# producer
while line = ARGF.gets
mon.synchronize do
buf.push(line)
empty_cond.signal
end
end
//}

2回ロックしても...

MonitorMixin (12.0)

スレッドの同期機構としてのモニター機能を提供するモジュールです。

...in) # 配列にモニタ機能を追加
empty_cond = buf.new_cond # 配列が空であるかないかを通知する条件変数

# consumer
Thread.start do
loop do
buf.synchronize do # ロックする
empty_cond.wait_while { buf.empty? } # 配列が空である間はロックを開放...
...end
end

# producer
while line = ARGF.gets
buf.synchronize do # ロックする
buf.push(line) # 配列を変更(追加)
empty_cond.signal # 配列に要素が追加されたことを条件変数を通して通知
end # ここでロックを開放
end
//}

=== 初期化

MonitorMixin...

NEWS for Ruby 3.0.0 (12.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...on context. 16786
* Thread
* Thread.ignore_deadlock accessor has been added for disabling the default deadlock detection, allowing the use of signal handlers to break deadlock. 13768
* Warning
* Warning#warn now supports a category keyword argument. 17122

== Stdlib updates

Outstanding...
...the request headers as a Hash in the second argument when the first argument is a URI. 16686
* Net::SMTP
* Add SNI support.
* Net::SMTP.start arguments are keyword arguments.
* TLS should not check the host name by default.
* OpenStruct
* Initialization is no longer lazy. 12136...

WEBrick::HTTPProxyServer (12.0)

プロクシの機能を提供するクラスです。CONNECT メソッドにも対応しています。

...います。

* https://magazine.rubyist.net/articles/0002/0002-WEBrickProxy.html

以下は完全に動作するプロクシサーバの例です。

require 'webrick'
require 'webrick/httpproxy'

s = WEBrick::HTTPProxyServer.new(Port: 8080)
Signal
.trap('INT') do
s.shutdown
end
s.start...

WEBrick::HTTPServer (12.0)

HTTP サーバの機能を提供するクラスです。

...rver.new({:DocumentRoot => '/home/username/public_html/',
:BindAddress => '127.0.0.1',
:Port => 10080})
srv.mount('/hoge.pl', WEBrick::HTTPServlet::CGIHandler, 'really_executed_script.rb')
Signal
.trap(:INT){ srv.shutdown }
srv.start...

絞り込み条件を変える

<< 1 2 > >>