るりまサーチ

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

別のキーワード

  1. _builtin to_h
  2. struct to_h
  3. hash to_h
  4. openstruct to_h
  5. ostruct to_h

検索結果

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

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

...ッドは Thread::ConditionVariable#wait
で指定した mutex のロックを試みます。

@return 常に self を返します。

//emlist[例][ruby]{
mutex = Mutex.new
cv = 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] (12314.0)

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

...以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を Hash で指定します。...
...
ドの配列を返します。

例:

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| ... } -> () (12314.0)

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

...以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を Hash で指定します。...
...
ドの配列を返します。

例:

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 (9036.0)

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

...一つである状態変数を実現するクラスです。

以下も ConditionVariable を理解するのに参考になります。

h
ttps://ruby-doc.com/docs/ProgrammingRuby/html/tut_threads.html#UF

=== Condition Variable とは

あるスレッド A が排他領域で動いていたとしま...
...状況を解決するのが Condition Variable です。

スレッド a で条件(リソースが空いているかなど)が満たされるまで wait メソッドで
スレッドを止めます。他のスレッド b において条件が満たされたなら signal
メソッドでスレッド a...
...= Mutex.new
cv = ConditionVariable.new

a = Thread.start {
mutex.synchronize {
...
while (条件が満たされない)
cv.wait(mutex)
end
...
}
}

b = Thread.start {
mutex.synchronize {
# 上の条...

WEBrick::HTTPProxyServer (9012.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 (9012.0)

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

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

以下は HTTP サーバとしてちゃんと動作する例です。

require 'webrick'
srv = WEBrick::HTTPServer.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...

ruby 1.8.4 feature (180.0)

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

...
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影...
...響の範囲が小さいと思われる変更もこちら
* [change]: 変更されたクラス/メソッドなど(互換性のない変更)
* [obsolete]: 廃止された(される予定の)機能
* [platform]: 対応プラットフォームの追加

== 目次

* ((<ruby 1.8.4 feature/Ruby...
...09-21) [i686-linux]
0
nil
# => ruby 1.8.4 (2005-12-22) [i686-linux]
0
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
#...

NEWS for Ruby 3.0.0 (30.0)

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

...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting...
...whether the current execution context is blocking. 16786
* Thread#join invokes the scheduler hooks `block`/`unblock` in a non-blocking execution context. 16786
* Thread
* Thread.ignore_deadlock accessor has been added for disabling the default deadlock detection, allowing the use of signal...
...erify_hostname have been added to skip hostname verification. 16555
* Net::HTTP.get, Net::HTTP.get_response, and Net::HTTP.get_print can take 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...