* what's cooking in kgio.git
@ 2012-12-27 2:13 4% Eric Wong
0 siblings, 0 replies; 5+ results
From: Eric Wong @ 2012-12-27 2:13 UTC (permalink / raw)
To: kgio
It's been a while since the last release :x
I've pushed out some changes which enable TCP Fast Open on Linux 3.7
I probably should've released 2.8.0 over the summer, but I
forgot about it and nobody reminded me (just ask here! :)
Anyways I'll see about releasing 2.8.0 sometime this week.
Comments greatly appreciated, especially on the API for
the TCP Fast Open client (patch coming in reply).
Eric Wong (10):
tryopen: avoid ambiguous name for subst function
test_poll: skip signal torture on Debian GNU/kfreebsd
test/lib_read_write: wait for readability before tryread
test workaround for platforms with unreliable signals
tryopen: include errno.h header just in case
connect: split out my_socket() function
connect: factor out tcp_getaddr() function
Kgio::Socket.new retains compatibility with Socket.new
implement TCP Fast Open support (client + server)
read_write: remove unused variable
Sokolov Yura 'funny-falcon (3):
Fix UnixClientReadServerWrite test class name
use rb_str_subseq for tail string on write
add `#kgio_writev` and `#kgio_trywritev`
ext/kgio/connect.c | 142 ++++++++++---
ext/kgio/extconf.rb | 4 +
ext/kgio/kgio.h | 23 +++
ext/kgio/kgio_ext.c | 35 ++++
ext/kgio/read_write.c | 310 ++++++++++++++++++++++++++++-
ext/kgio/tryopen.c | 5 +-
test/lib_read_write.rb | 129 ++++++++++++
test/lib_server_accept.rb | 8 +-
test/test_poll.rb | 8 +-
test/test_socket.rb | 14 ++
test/test_tfo.rb | 70 +++++++
test/test_unix_client_read_server_write.rb | 2 +-
12 files changed, 715 insertions(+), 35 deletions(-)
^ permalink raw reply [relevance 4%]
* [PATCH] tryopen: avoid ambiguous name for subst function
@ 2012-05-31 22:25 4% Eric Wong
0 siblings, 0 replies; 5+ results
From: Eric Wong @ 2012-05-31 22:25 UTC (permalink / raw)
To: kgio
Define rb_thread_blocking_region as a macro for MRI 1.8
to prevent confusing output in tools such as valgrind/gdb.
---
I've pushed this to kgio master along with two of funny-falcon's
patches:
Sokolov Yura 'funny-falcon (2):
Fix UnixClientReadServerWrite test class name
use rb_str_subseq for tail string on write
git://bogomips.org/kgio
http://bogomips.org/kgio.git
ext/kgio/tryopen.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ext/kgio/tryopen.c b/ext/kgio/tryopen.c
index 6b63673..f8044a5 100644
--- a/ext/kgio/tryopen.c
+++ b/ext/kgio/tryopen.c
@@ -42,7 +42,7 @@ static VALUE nogvl_open(void *ptr)
# include "rubysig.h"
typedef void rb_unblock_function_t(void *);
typedef VALUE rb_blocking_function_t(void *);
-static VALUE rb_thread_blocking_region(
+static VALUE my_thread_blocking_region(
rb_blocking_function_t *fn, void *data1,
rb_unblock_function_t *ubf, void *data2)
{
@@ -54,6 +54,8 @@ static VALUE rb_thread_blocking_region(
return rv;
}
+#define rb_thread_blocking_region(fn,data1,ubf,data2) \
+ my_thread_blocking_region((fn),(data1),(ubf),(data2))
#endif /* ! HAVE_RB_THREAD_BLOCKING_REGION */
/*
--
Eric Wong
^ permalink raw reply related [relevance 4%]
* Re: [PATCH 2/3] use rb_str_subseq for tail string on write
2012-05-30 18:57 7% ` Eric Wong
@ 2012-05-30 19:29 7% ` Юрий Соколов
0 siblings, 0 replies; 5+ results
From: Юрий Соколов @ 2012-05-30 19:29 UTC (permalink / raw)
To: kgio
2012/5/30 Eric Wong <normalperson@yhbt.net>
> Sokolov Yura 'funny-falcon <funny.falcon@gmail.com> wrote:
> > Use rb_str_subseq for taking string's tail. rb_str_subseq do not allocate
> > additional memory in this case. And although it prevents from collecting
> > original string, it seems that tests wins both in performance and in
> memory
> > usage.
> >
> > Use fallback to rb_str_substr on ruby1.8
>
> Thanks, applied (along with your PATCH 1/3). Will push.
> Looking at 3/3 now.
>
> By the way, do you test under Rubinius? I haven't in a while, but it
> looks like rb_str_substr() works in rbx.
>
Oh, I didn't test under Rubinius, only REE and 1.9.3p194
^ permalink raw reply [relevance 7%]
* Re: [PATCH 2/3] use rb_str_subseq for tail string on write
2012-05-30 13:56 6% ` [PATCH 2/3] use rb_str_subseq for tail string on write Sokolov Yura 'funny-falcon
@ 2012-05-30 18:57 7% ` Eric Wong
2012-05-30 19:29 7% ` Юрий Соколов
0 siblings, 1 reply; 5+ results
From: Eric Wong @ 2012-05-30 18:57 UTC (permalink / raw)
To: kgio
Sokolov Yura 'funny-falcon <funny.falcon@gmail.com> wrote:
> Use rb_str_subseq for taking string's tail. rb_str_subseq do not allocate
> additional memory in this case. And although it prevents from collecting
> original string, it seems that tests wins both in performance and in memory
> usage.
>
> Use fallback to rb_str_substr on ruby1.8
Thanks, applied (along with your PATCH 1/3). Will push.
Looking at 3/3 now.
By the way, do you test under Rubinius? I haven't in a while, but it
looks like rb_str_substr() works in rbx.
^ permalink raw reply [relevance 7%]
* [PATCH 2/3] use rb_str_subseq for tail string on write
@ 2012-05-30 13:56 6% ` Sokolov Yura 'funny-falcon
2012-05-30 18:57 7% ` Eric Wong
0 siblings, 1 reply; 5+ results
From: Sokolov Yura 'funny-falcon @ 2012-05-30 13:56 UTC (permalink / raw)
To: kgio
Use rb_str_subseq for taking string's tail. rb_str_subseq do not allocate
additional memory in this case. And although it prevents from collecting
original string, it seems that tests wins both in performance and in memory
usage.
Use fallback to rb_str_substr on ruby1.8
---
ext/kgio/extconf.rb | 1 +
ext/kgio/read_write.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ext/kgio/extconf.rb b/ext/kgio/extconf.rb
index fb680f7..f6bd0cc 100644
--- a/ext/kgio/extconf.rb
+++ b/ext/kgio/extconf.rb
@@ -49,5 +49,6 @@ have_func('rb_thread_io_blocking_region')
have_func('rb_str_set_len')
have_func('rb_time_interval')
have_func('rb_wait_for_single_fd')
+have_func('rb_str_subseq')
create_makefile('kgio_ext')
diff --git a/ext/kgio/read_write.c b/ext/kgio/read_write.c
index 51d2d16..9924743 100644
--- a/ext/kgio/read_write.c
+++ b/ext/kgio/read_write.c
@@ -4,6 +4,9 @@
static VALUE sym_wait_readable, sym_wait_writable;
static VALUE eErrno_EPIPE, eErrno_ECONNRESET;
static ID id_set_backtrace;
+#ifndef HAVE_RB_STR_SUBSEQ
+#define rb_str_subseq rb_str_substr
+#endif
/*
* we know MSG_DONTWAIT works properly on all stream sockets under Linux
@@ -338,7 +341,7 @@ done:
a->ptr = RSTRING_PTR(a->buf) + written;
return -1;
} else if (written > 0) {
- a->buf = rb_str_new(a->ptr, a->len);
+ a->buf = rb_str_subseq(a->buf, written, a->len);
} else {
a->buf = sym_wait_writable;
}
--
1.7.9.5
^ permalink raw reply related [relevance 6%]
Results 1-5 of 5 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2012-05-30 13:56 [PATCH 1/3] Fix UnixClientReadServerWrite test class name Sokolov Yura 'funny-falcon
2012-05-30 13:56 6% ` [PATCH 2/3] use rb_str_subseq for tail string on write Sokolov Yura 'funny-falcon
2012-05-30 18:57 7% ` Eric Wong
2012-05-30 19:29 7% ` Юрий Соколов
2012-05-31 22:25 4% [PATCH] tryopen: avoid ambiguous name for subst function Eric Wong
2012-12-27 2:13 4% what's cooking in kgio.git Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/kgio.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).