<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/test_tmpdir.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/tmpdir] Restore Ractor.yield style test for old version of Ruby</title>
<updated>2025-06-03T09:13:15+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-06-03T07:49:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=135583e37c06267debf77ee60a8540dfe70bec8f'/>
<id>135583e37c06267debf77ee60a8540dfe70bec8f</id>
<content type='text'>
https://github.com/ruby/tmpdir/commit/f12c766996
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/tmpdir/commit/f12c766996
</pre>
</div>
</content>
</entry>
<entry>
<title>`Ractor::Port`</title>
<updated>2025-05-30T19:01:33+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2025-05-26T18:58:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ef2bb61018cd9ccb5b61a3d91911e04a773da4a7'/>
<id>ef2bb61018cd9ccb5b61a3d91911e04a773da4a7</id>
<content type='text'>
* Added `Ractor::Port`
  * `Ractor::Port#receive` (support multi-threads)
  * `Rcator::Port#close`
  * `Ractor::Port#closed?`
* Added some methods
  * `Ractor#join`
  * `Ractor#value`
  * `Ractor#monitor`
  * `Ractor#unmonitor`
* Removed some methods
  * `Ractor#take`
  * `Ractor.yield`
* Change the spec
  * `Racotr.select`

You can wait for multiple sequences of messages with `Ractor::Port`.

```ruby
ports = 3.times.map{ Ractor::Port.new }
ports.map.with_index do |port, ri|
  Ractor.new port,ri do |port, ri|
    3.times{|i| port &lt;&lt; "r#{ri}-#{i}"}
  end
end

p ports.each{|port| pp 3.times.map{port.receive}}

```

In this example, we use 3 ports, and 3 Ractors send messages to them respectively.
We can receive a series of messages from each port.

You can use `Ractor#value` to get the last value of a Ractor's block:

```ruby
result = Ractor.new do
  heavy_task()
end.value
```

You can wait for the termination of a Ractor with `Ractor#join` like this:

```ruby
Ractor.new do
  some_task()
end.join
```

`#value` and `#join` are similar to `Thread#value` and `Thread#join`.

To implement `#join`, `Ractor#monitor` (and `Ractor#unmonitor`) is introduced.

This commit changes `Ractor.select()` method.
It now only accepts ports or Ractors, and returns when a port receives a message or a Ractor terminates.

We removes `Ractor.yield` and `Ractor#take` because:
* `Ractor::Port` supports most of similar use cases in a simpler manner.
* Removing them significantly simplifies the code.

We also change the internal thread scheduler code (thread_pthread.c):
* During barrier synchronization, we keep the `ractor_sched` lock to avoid deadlocks.
  This lock is released by `rb_ractor_sched_barrier_end()`
  which is called at the end of operations that require the barrier.
* fix potential deadlock issues by checking interrupts just before setting UBF.

https://bugs.ruby-lang.org/issues/21262
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Added `Ractor::Port`
  * `Ractor::Port#receive` (support multi-threads)
  * `Rcator::Port#close`
  * `Ractor::Port#closed?`
* Added some methods
  * `Ractor#join`
  * `Ractor#value`
  * `Ractor#monitor`
  * `Ractor#unmonitor`
* Removed some methods
  * `Ractor#take`
  * `Ractor.yield`
* Change the spec
  * `Racotr.select`

You can wait for multiple sequences of messages with `Ractor::Port`.

```ruby
ports = 3.times.map{ Ractor::Port.new }
ports.map.with_index do |port, ri|
  Ractor.new port,ri do |port, ri|
    3.times{|i| port &lt;&lt; "r#{ri}-#{i}"}
  end
end

p ports.each{|port| pp 3.times.map{port.receive}}

```

In this example, we use 3 ports, and 3 Ractors send messages to them respectively.
We can receive a series of messages from each port.

You can use `Ractor#value` to get the last value of a Ractor's block:

```ruby
result = Ractor.new do
  heavy_task()
end.value
```

You can wait for the termination of a Ractor with `Ractor#join` like this:

```ruby
Ractor.new do
  some_task()
end.join
```

`#value` and `#join` are similar to `Thread#value` and `Thread#join`.

To implement `#join`, `Ractor#monitor` (and `Ractor#unmonitor`) is introduced.

This commit changes `Ractor.select()` method.
It now only accepts ports or Ractors, and returns when a port receives a message or a Ractor terminates.

We removes `Ractor.yield` and `Ractor#take` because:
* `Ractor::Port` supports most of similar use cases in a simpler manner.
* Removing them significantly simplifies the code.

We also change the internal thread scheduler code (thread_pthread.c):
* During barrier synchronization, we keep the `ractor_sched` lock to avoid deadlocks.
  This lock is released by `rb_ractor_sched_barrier_end()`
  which is called at the end of operations that require the barrier.
* fix potential deadlock issues by checking interrupts just before setting UBF.

https://bugs.ruby-lang.org/issues/21262
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tmpdir] Fix for path-like objects</title>
<updated>2024-12-16T09:40:01+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-12-16T09:31:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bf0f3239071a9fa11dc1b9553106eb37c89f384c'/>
<id>bf0f3239071a9fa11dc1b9553106eb37c89f384c</id>
<content type='text'>
Fix https://github.com/ruby/tmpdir/pull/37

https://github.com/ruby/tmpdir/commit/a8ceafae7d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix https://github.com/ruby/tmpdir/pull/37

https://github.com/ruby/tmpdir/commit/a8ceafae7d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tmpdir] Reject empty parent path</title>
<updated>2024-09-10T08:44:50+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-10-25T07:44:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a79907ed5e8014215a658f4731ff33df3aca9eaa'/>
<id>a79907ed5e8014215a658f4731ff33df3aca9eaa</id>
<content type='text'>
https://github.com/ruby/tmpdir/commit/628c5bdc59
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/tmpdir/commit/628c5bdc59
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tmpdir] [Bug #18933] Make `Dir.mktmpdir` Ractor-safe</title>
<updated>2023-07-03T05:47:43+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-10-25T03:15:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3e605a781970cef365002167634a1b5a176bffcb'/>
<id>3e605a781970cef365002167634a1b5a176bffcb</id>
<content type='text'>
Fix https://bugs.ruby-lang.org/issues/18933

https://github.com/ruby/tmpdir/commit/446e636434
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix https://bugs.ruby-lang.org/issues/18933

https://github.com/ruby/tmpdir/commit/446e636434
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tmpdir] Warnings should contain the environment variable name </title>
<updated>2022-10-27T03:12:00+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-10-26T12:20:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cb80ee7a4a3967be3a0ce687ec76522f1680600b'/>
<id>cb80ee7a4a3967be3a0ce687ec76522f1680600b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tmpdir] Ignore empty environment variables</title>
<updated>2022-10-25T07:54:40+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-10-25T07:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=114e71d06280f9c57b9859ee4405ae89a989ddb6'/>
<id>114e71d06280f9c57b9859ee4405ae89a989ddb6</id>
<content type='text'>
Fixes https://github.com/ruby/tmpdir/pull/17

https://github.com/ruby/tmpdir/commit/a79c727a5d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes https://github.com/ruby/tmpdir/pull/17

https://github.com/ruby/tmpdir/commit/a79c727a5d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tmpdir] Use omit instead of skip for test-unit</title>
<updated>2022-01-11T12:50:53+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2022-01-11T12:36:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=34ebf82e839bf542444a92e075853ff8f6332156'/>
<id>34ebf82e839bf542444a92e075853ff8f6332156</id>
<content type='text'>
https://github.com/ruby/tmpdir/commit/40107b59b3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/tmpdir/commit/40107b59b3
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tmpdir] Make usable chars more strict</title>
<updated>2021-04-05T12:08:57+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-03-31T16:17:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4b6fa03a72b23fa03a8f37cbfdcad3f0251832cf'/>
<id>4b6fa03a72b23fa03a8f37cbfdcad3f0251832cf</id>
<content type='text'>
Remove other than alphanumeric and some punctuations considered
filesystem-safe, instead of removing some unsafe chars only.

https://hackerone.com/reports/1131465

https://github.com/ruby/tmpdir/commit/adf294bc2d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove other than alphanumeric and some punctuations considered
filesystem-safe, instead of removing some unsafe chars only.

https://hackerone.com/reports/1131465

https://github.com/ruby/tmpdir/commit/adf294bc2d
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/tmpdir] Warn when environment variables skipped (fixes #2)</title>
<updated>2020-09-14T09:22:37+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-07-16T08:45:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=edb5c67195129e1d10f329edb55e486e1874b20e'/>
<id>edb5c67195129e1d10f329edb55e486e1874b20e</id>
<content type='text'>
https://github.com/ruby/tmpdir/commit/af7b020a89
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/tmpdir/commit/af7b020a89
</pre>
</div>
</content>
</entry>
</feed>
