[前][次][番号順一覧][スレッド一覧]

ruby-changes:33832

From: normal <ko1@a...>
Date: Sun, 11 May 2014 08:49:10 +0900 (JST)
Subject: [ruby-changes:33832] normal:r45913 (trunk): vm*: doubly-linked list from ccan to manage vm->living_threads

normal	2014-05-11 08:48:51 +0900 (Sun, 11 May 2014)

  New Revision: 45913

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45913

  Log:
    vm*: doubly-linked list from ccan to manage vm->living_threads
    
    A doubly-linked list for tracking living threads guarantees
    constant-time insert/delete performance with no corner cases of a
    hash table.  I chose this ccan implementation of doubly-linked
    lists over the BSD sys/queue.h implementation since:
    
    1) insertion and removal are both branchless
    2) locality is improved if a struct may be a member of multiple lists
       (0002 patch in Feature 9632 will introduce a secondary list
       for waiting FDs)
    
    This also increases cache locality during iteration: improving
    performance in a new IO#close benchmark with many sleeping threads
    while still scanning the same number of threads.
    
    vm_thread_close 1.762
    
    * vm_core.h (rb_vm_t): list_head and counter for living_threads
      (rb_thread_t): vmlt_node for living_threads linkage
      (rb_vm_living_threads_init): new function wrapper
      (rb_vm_living_threads_insert): ditto
      (rb_vm_living_threads_remove): ditto
    * vm.c (rb_vm_living_threads_foreach): new function wrapper
    * thread.c (terminate_i, thread_start_func_2, thread_create_core,
      thread_fd_close_i, thread_fd_close): update to use new APIs
    * vm.c (vm_mark_each_thread_func, rb_vm_mark, ruby_vm_destruct,
      vm_memsize, vm_init2, Init_VM): ditto
    * vm_trace.c (clear_trace_func_i, rb_clear_trace_func): ditto
    * benchmark/bm_vm_thread_close.rb: added to show improvement
    * ccan/build_assert/build_assert.h: added as a dependency of list.h
    * ccan/check_type/check_type.h: ditto
    * ccan/container_of/container_of.h: ditto
    * ccan/licenses/BSD-MIT: ditto
    * ccan/licenses/CC0: ditto
    * ccan/str/str.h: ditto (stripped of unused macros)
    * ccan/list/list.h: ditto
    * common.mk: add CCAN_LIST_INCLUDES
      [ruby-core:61871][Feature 9632 (part 1)]
    
    Apologies for the size of this commit, but I think a good
    doubly-linked list will be useful for future features, too.
    This may be used to add ordering to a container_of-based hash
    table to preserve compatibility if required (e.g. feature 9614).

  Added directories:
    trunk/ccan/
    trunk/ccan/build_assert/
    trunk/ccan/check_type/
    trunk/ccan/container_of/
    trunk/ccan/licenses/
    trunk/ccan/list/
    trunk/ccan/str/
  Added files:
    trunk/benchmark/bm_vm_thread_close.rb
    trunk/ccan/build_assert/build_assert.h
    trunk/ccan/check_type/check_type.h
    trunk/ccan/container_of/container_of.h
    trunk/ccan/licenses/BSD-MIT
    trunk/ccan/licenses/CC0
    trunk/ccan/list/list.h
    trunk/ccan/str/str.h
  Modified files:
    trunk/ChangeLog
    trunk/common.mk
    trunk/thread.c
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_trace.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45912)
+++ ChangeLog	(revision 45913)
@@ -1,3 +1,27 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun May 11 08:02:49 2014  Eric Wong  <e@8...>
+
+	* vm_core.h (rb_vm_t): list_head and counter for living_threads
+	  (rb_thread_t): vmlt_node for living_threads linkage
+	  (rb_vm_living_threads_init): new function wrapper
+	  (rb_vm_living_threads_insert): ditto
+	  (rb_vm_living_threads_remove): ditto
+	* vm.c (rb_vm_living_threads_foreach): new function wrapper
+	* thread.c (terminate_i, thread_start_func_2, thread_create_core,
+	  thread_fd_close_i, thread_fd_close): update to use new APIs
+	* vm.c (vm_mark_each_thread_func, rb_vm_mark, ruby_vm_destruct,
+	  vm_memsize, vm_init2, Init_VM): ditto
+	* vm_trace.c (clear_trace_func_i, rb_clear_trace_func): ditto
+	* benchmark/bm_vm_thread_close.rb: added to show improvement
+	* ccan/build_assert/build_assert.h: added as a dependency of list.h
+	* ccan/check_type/check_type.h: ditto
+	* ccan/container_of/container_of.h: ditto
+	* ccan/licenses/BSD-MIT: ditto
+	* ccan/licenses/CC0: ditto
+	* ccan/str/str.h: ditto (stripped of unused macros)
+	* ccan/list/list.h: ditto
+	* common.mk: add CCAN_LIST_INCLUDES
+	  [ruby-core:61871][Feature #9632 (part 1)]
+
 Sun May 11 01:10:31 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* signal.c (rb_f_kill): directly enqueue an ignored signal to self,
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 45912)
+++ vm_core.h	(revision 45913)
@@ -23,8 +23,8 @@ https://github.com/ruby/ruby/blob/trunk/vm_core.h#L23
 #include "id.h"
 #include "method.h"
 #include "ruby_atomic.h"
-
 #include "thread_native.h"
+#include "ccan/list/list.h"
 
 #ifndef ENABLE_VM_OBJSPACE
 #ifdef _WIN32
@@ -333,7 +333,8 @@ typedef struct rb_vm_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L333
     struct rb_thread_struct *main_thread;
     struct rb_thread_struct *running_thread;
 
-    st_table *living_threads;
+    struct list_head living_threads;
+    size_t living_thread_num;
     VALUE thgroup_default;
 
     int running;
@@ -501,6 +502,7 @@ typedef struct rb_ensure_list { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L502
 } rb_ensure_list_t;
 
 typedef struct rb_thread_struct {
+    struct list_node vmlt_node;
     VALUE self;
     rb_vm_t *vm;
 
@@ -856,6 +858,28 @@ void rb_thread_stop_timer_thread(int); https://github.com/ruby/ruby/blob/trunk/vm_core.h#L858
 void rb_thread_reset_timer_thread(void);
 void rb_thread_wakeup_timer_thread(void);
 
+static inline void
+rb_vm_living_threads_init(rb_vm_t *vm)
+{
+    list_head_init(&vm->living_threads);
+    vm->living_thread_num = 0;
+}
+
+static inline void
+rb_vm_living_threads_insert(rb_vm_t *vm, rb_thread_t *th)
+{
+    list_add(&vm->living_threads, &th->vmlt_node);
+    vm->living_thread_num++;
+}
+
+static inline void
+rb_vm_living_threads_remove(rb_vm_t *vm, rb_thread_t *th)
+{
+    list_del(&th->vmlt_node);
+    vm->living_thread_num--;
+}
+
+void rb_vm_living_threads_foreach(rb_vm_t*, int (*)(rb_thread_t*, void*), void*);
 int ruby_thread_has_gvl_p(void);
 typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE);
 rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, const rb_control_frame_t *cfp);
Index: thread.c
===================================================================
--- thread.c	(revision 45912)
+++ thread.c	(revision 45913)
@@ -368,12 +368,8 @@ rb_threadptr_trap_interrupt(rb_thread_t https://github.com/ruby/ruby/blob/trunk/thread.c#L368
 }
 
 static int
-terminate_i(st_data_t key, st_data_t val, rb_thread_t *main_thread)
+terminate_i(rb_thread_t *th, void *main_thread)
 {
-    VALUE thval = key;
-    rb_thread_t *th;
-    GetThreadPtr(thval, th);
-
     if (th != main_thread) {
 	thread_debug("terminate_i: %p\n", (void *)th);
 	rb_threadptr_pending_interrupt_enque(th, eTerminateSignal);
@@ -433,7 +429,7 @@ rb_thread_terminate_all(void) https://github.com/ruby/ruby/blob/trunk/thread.c#L429
 
   retry:
     thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th);
-    st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
+    rb_vm_living_threads_foreach(vm, terminate_i, th);
 
     while (!rb_thread_alone()) {
 	int state;
@@ -585,7 +581,7 @@ thread_start_func_2(rb_thread_t *th, VAL https://github.com/ruby/ruby/blob/trunk/thread.c#L581
 	}
 
 	/* delete self other than main thread from living_threads */
-	st_delete_wrap(th->vm->living_threads, th->self);
+	rb_vm_living_threads_remove(th->vm, th);
 	if (rb_thread_alone()) {
 	    /* I'm last thread. wake up main thread from rb_thread_terminate_all */
 	    rb_threadptr_interrupt(main_th);
@@ -657,7 +653,7 @@ thread_create_core(VALUE thval, VALUE ar https://github.com/ruby/ruby/blob/trunk/thread.c#L653
 	th->status = THREAD_KILLED;
 	rb_raise(rb_eThreadError, "can't create Thread: %s", strerror(err));
     }
-    st_insert(th->vm->living_threads, thval, (st_data_t) th->thread_id);
+    rb_vm_living_threads_insert(th->vm, th);
     return thval;
 }
 
@@ -2067,13 +2063,10 @@ rb_threadptr_reset_raised(rb_thread_t *t https://github.com/ruby/ruby/blob/trunk/thread.c#L2063
 }
 
 static int
-thread_fd_close_i(st_data_t key, st_data_t val, st_data_t data)
+thread_fd_close_i(rb_thread_t *th, void *fdp)
 {
-    int fd = (int)data;
-    rb_thread_t *th;
-    GetThreadPtr((VALUE)key, th);
-
-    if (th->waiting_fd == fd) {
+    int *fd = fdp;
+    if (th->waiting_fd == *fd) {
 	VALUE err = th->vm->special_exceptions[ruby_error_closed_stream];
 	rb_threadptr_pending_interrupt_enque(th, err);
 	rb_threadptr_interrupt(th);
@@ -2084,7 +2077,7 @@ thread_fd_close_i(st_data_t key, st_data https://github.com/ruby/ruby/blob/trunk/thread.c#L2077
 void
 rb_thread_fd_close(int fd)
 {
-    st_foreach(GET_THREAD()->vm->living_threads, thread_fd_close_i, (st_index_t)fd);
+    rb_vm_living_threads_foreach(GET_THREAD()->vm, thread_fd_close_i, &fd);
 }
 
 /*
@@ -2304,11 +2297,9 @@ rb_thread_stop(void) https://github.com/ruby/ruby/blob/trunk/thread.c#L2297
 }
 
 static int
-thread_list_i(st_data_t key, st_data_t val, void *data)
+thread_list_i(rb_thread_t *th, void *data)
 {
     VALUE ary = (VALUE)data;
-    rb_thread_t *th;
-    GetThreadPtr((VALUE)key, th);
 
     switch (th->status) {
       case THREAD_RUNNABLE:
@@ -2347,7 +2338,7 @@ VALUE https://github.com/ruby/ruby/blob/trunk/thread.c#L2338
 rb_thread_list(void)
 {
     VALUE ary = rb_ary_new();
-    st_foreach(GET_THREAD()->vm->living_threads, thread_list_i, ary);
+    rb_vm_living_threads_foreach(GET_THREAD()->vm, thread_list_i, (void *)ary);
     return ary;
 }
 
@@ -2925,14 +2916,14 @@ thread_keys_i(ID key, VALUE value, VALUE https://github.com/ruby/ruby/blob/trunk/thread.c#L2916
 static int
 vm_living_thread_num(rb_vm_t *vm)
 {
-    return (int)vm->living_threads->num_entries;
+    return (int)vm->living_thread_num;
 }
 
 int
 rb_thread_alone(void)
 {
     int num = 1;
-    if (GET_THREAD()->vm->living_threads) {
+    if (!list_empty(&GET_THREAD()->vm->living_threads)) {
 	num = vm_living_thread_num(GET_THREAD()->vm);
 	thread_debug("rb_thread_alone: %d\n", num);
     }
@@ -3767,28 +3758,23 @@ clear_coverage(void) https://github.com/ruby/ruby/blob/trunk/thread.c#L3758
 }
 
 static void
-rb_thread_atfork_internal(int (*atfork)(st_data_t, st_data_t, st_data_t))
+rb_thread_atfork_internal(int (*atfork)(rb_thread_t *, void *))
 {
     rb_thread_t *th = GET_THREAD();
     rb_vm_t *vm = th->vm;
-    VALUE thval = th->self;
     vm->main_thread = th;
 
     gvl_atfork(th->vm);
-    st_foreach(vm->living_threads, atfork, (st_data_t)th);
-    st_clear(vm->living_threads);
-    st_insert(vm->living_threads, thval, (st_data_t)th->thread_id);
+    rb_vm_living_threads_foreach(vm, atfork, th);
+    rb_vm_living_threads_init(vm);
+    rb_vm_living_threads_insert(vm, th);
     vm->sleeper = 0;
     clear_coverage();
 }
 
 static int
-terminate_atfork_i(st_data_t key, st_data_t val, st_data_t current_th)
+terminate_atfork_i(rb_thread_t *th, void *current_th)
 {
-    VALUE thval = key;
-    rb_thread_t *th;
-    GetThreadPtr(thval, th);
-
     if (th != (rb_thread_t *)current_th) {
 	rb_mutex_abandon_keeping_mutexes(th);
 	rb_mutex_abandon_locking_mutex(th);
@@ -3808,12 +3794,8 @@ rb_thread_atfork(void) https://github.com/ruby/ruby/blob/trunk/thread.c#L3794
 }
 
 static int
-terminate_atfork_before_exec_i(st_data_t key, st_data_t val, st_data_t current_th)
+terminate_atfork_before_exec_i(rb_thread_t *th, void *current_th)
 {
-    VALUE thval = key;
-    rb_thread_t *th;
-    GetThreadPtr(thval, th);
-
     if (th != (rb_thread_t *)current_th) {
 	thread_cleanup_func_before_exec(th);
     }
@@ -3881,13 +3863,12 @@ struct thgroup_list_params { https://github.com/ruby/ruby/blob/trunk/thread.c#L3863
 };
 
 static int
-thgroup_list_i(st_data_t key, st_data_t val, st_data_t data)
+thgroup_list_i(rb_thread_t *th, void *arg)
 {
-    VALUE thread = (VALUE)key;
-    VALUE ary = ((struct thgroup_list_params *)data)->ary;
-    VALUE group = ((struct thgroup_list_params *)data)->group;
-    rb_thread_t *th;
-    GetThreadPtr(thread, th);
+    struct thgroup_list_params *params = arg;
+    VALUE thread = th->self;
+    VALUE ary = params->ary;
+    VALUE group = params->group;
 
     if (th->thgroup == group) {
 	rb_ary_push(ary, thread);
@@ -3912,7 +3893,7 @@ thgroup_list(VALUE group) https://github.com/ruby/ruby/blob/trunk/thread.c#L3893
 
     param.ary = ary;
     param.group = group;
-    st_foreach(GET_THREAD()->vm->living_threads, thgroup_list_i, (st_data_t) & param);
+    rb_vm_living_threads_foreach(GET_THREAD()->vm, thgroup_list_i, &param);
     return ary;
 }
 
@@ -5051,12 +5032,9 @@ ruby_native_thread_p(void) https://github.com/ruby/ruby/blob/trunk/thread.c#L5032
 }
 
 static int
-check_deadlock_i(st_data_t key, st_data_t val, int *found)
+check_deadlock_i(rb_thread_t *th, void *arg)
 {
-    VALUE thval = key;
-    rb_thread_t *th;
-    GetThreadPtr(thval, th);
-
+    int *found = arg;
     if (th->status != THREAD_STOPPED_FOREVER || RUBY_VM_INTERRUPTED(th)) {
 	*found = 1;
     }
@@ -5076,12 +5054,8 @@ check_deadlock_i(st_data_t key, st_data_ https://github.com/ruby/ruby/blob/trunk/thread.c#L5054
 
 #ifdef DEBUG_DEADLOCK_CHECK
 static int
-debug_i(st_data_t key, st_data_t val, int *found)
+debug_i(rb_thread_t *th, int *found)
 {
-    VALUE thval = key;
-    rb_thread_t *th;
-    GetThreadPtr(thval, th);
-
     printf("th:%p %d %d", th, th->status, th->interrupt_flag);
     if (th->locking_mutex) {
 	rb_mutex_t *mutex;
@@ -5107,15 +5081,15 @@ rb_check_deadlock(rb_vm_t *vm) https://github.com/ruby/ruby/blob/trunk/thread.c#L5081
     if (vm_living_thread_num(vm) < vm->sleeper) rb_bug("sleeper must not be more than vm_living_thread_num(vm)");
     if (patrol_thread && patrol_thread != GET_THREAD()) return;
 
-    st_foreach(vm->living_threads, check_deadlock_i, (st_data_t)&found);
+    rb_vm_living_threads_foreach(vm, check_deadlock_i, &found);
 
     if (!found) {
 	VALUE argv[2];
 	argv[0] = rb_eFatal;
 	argv[1] = rb_str_new2("No live threads left. Deadlock?");
 #ifdef DEBUG_DEADLOCK_CHECK
-	printf("%d %d %p %p\n", vm->living_threads->num_entries, vm->sleeper, GET_THREAD(), vm->main_thread);
-	st_foreach(vm->living_threads, debug_i, (st_data_t)0);
+	printf("%d %d %p %p\n", vm_living_thread_num(vm), vm->sleeper, GET_THREAD(), vm->main_thread);
+	rb_vm_living_threads_foreach(vm, debug_i, 0);
 #endif
 	vm->sleeper--;
 	rb_threadptr_raise(vm->main_thread, 2, argv);
Index: common.mk
===================================================================
--- common.mk	(revision 45912)
+++ common.mk	(revision 45913)
@@ -600,6 +600,12 @@ $(PLATFORM_D): https://github.com/ruby/ruby/blob/trunk/common.mk#L600
 	@exit > $@
 
 ###
+CCAN_DIR = {$(VPATH)}ccan
+CCAN_LIST_INCLUDES = $(CCAN_DIR)/build_assert/build_assert.h \
+			$(CCAN_DIR)/check_type/check_type.h \
+			$(CCAN_DIR)/container_of/container_of.h \
+			$(CCAN_DIR)/list/list.h \
+			$(CCAN_DIR)/str/str.h
 
 RUBY_H_INCLUDES    = {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
 		     {$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
@@ -608,7 +614,8 @@ ENCODING_H_INCLUDES= {$(VPATH)}encoding. https://github.com/ruby/ruby/blob/trunk/common.mk#L614
 PROBES_H_INCLUDES  = {$(VPATH)}probes.h
 VM_CORE_H_INCLUDES = {$(VPATH)}vm_core.h {$(VPATH)}thread_$(THREAD_MODEL).h \
 		     {$(VPATH)}node.h {$(VPATH)}method.h {$(VPATH)}ruby_atomic.h \
-	             {$(VPATH)}vm_debug.h {$(VPATH)}id.h {$(VPATH)}thread_native.h
+	             {$(VPATH)}vm_debug.h {$(VPATH)}id.h {$(VPATH)}thread_native.h \
+	             $(CCAN_LIST_INCLUDES)
 
 ###
 
Index: ccan/build_assert/build_assert.h
===================================================================
--- ccan/build_assert/build_assert.h	(revision 0)
+++ ccan/build_assert/build_assert.h	(revision 45913)
@@ -0,0 +1,40 @@ https://github.com/ruby/ruby/blob/trunk/ccan/build_assert/build_assert.h#L1
+/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
+#ifndef CCAN_BUILD_ASSERT_H
+#define CCAN_BUILD_ASSERT_H
+
+/**
+ * BUILD_ASSERT - assert a build-time dependency.
+ * @cond: the compile-time condition which must be true.
+ *
+ * Your compile will fail if the condition isn't true, or can't be evaluated
+ * by the compiler.  This can only be used within a function.
+ *
+ * Example:
+ *	#include <stddef.h>
+ *	...
+ *	static char *foo_to_char(struct foo *foo)
+ *	{
+ *		// This code needs string to be at start of foo.
+ *		BUILD_ASSERT(offsetof(struct foo, string) == 0);
+ *		return (char *)foo;
+ *	}
+ */
+#define BUILD_ASSERT(cond) \
+	do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
+
+/**
+ * BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
+ * @cond: the compile-time condition which must be true.
+ *
+ * Your compile will fail if the condition isn't true, or can't be evaluated
+ * by the compiler.  This can be used in an expression: its value is "0".
+ *
+ * Example:
+ *	#define foo_to_char(foo)					\
+ *		 ((char *)(foo)						\
+ *		  + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
+ */
+#define BUILD_ASSERT_OR_ZERO(cond) \
+	(sizeof(char [1 - 2*!(cond)]) - 1)
+
+#endif /* CCAN_BUILD_ASSERT_H */
Index: ccan/licenses/BSD-MIT
===================================================================
--- ccan/licenses/BSD-MIT	(revision 0)
+++ ccan/licenses/BSD-MIT	(revision 45913)
@@ -0,0 +1,17 @@ https://github.com/ruby/ruby/blob/trunk/ccan/licenses/BSD-MIT#L1
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Index: ccan/licenses/CC0
===================================================================
--- ccan/licenses/CC0	(revision 0)
+++ ccan/licenses/CC0	(revision 45913)
@@ -0,0 +1,28 @@ https://github.com/ruby/ruby/blob/trunk/ccan/licenses/CC0#L1
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
+
+    the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
+    moral rights retained by the original author(s) and/or performer(s);
+    publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
+    rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
+    rights protecting the extraction, dissemination, use and reuse of data in a Work;
+    database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
+    other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any
  other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Af (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]