A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-April/003654.html below:

[Python-Dev] baby steps for free-threading

[Thread-SIG] Re: [Python-Dev] baby steps for free-threading [Thread-SIG] Re: [Python-Dev] baby steps for free-threadingSalz, Rich SalzR@CertCo.com
Wed, 19 Apr 2000 12:04:48 -0400
>In my experience, allowing/requiring programmers to specify sharedness is
>a very rich source of hard-to-find bugs.

My experience is the opposite, since most objects aren't shared. :)
You could probably do something like add an "owning thread" to each object
structure, and on refcount throw an exception if not shared and the current
thread isn't the owner. Not sure if space is a concern, but since the object
is either shared or needs its own mutex, you make them a union:
	bool shared;
	union {
		python_thread_id_type id;
		python_mutex_type m;
	};


  (Not saying I have an answer to
the performance hit of locking on incref/decref, just saying that the
development cost of 'shared' is very high.)

Greg


_______________________________________________
Thread-SIG maillist  -  Thread-SIG@python.org
http://www.python.org/mailman/listinfo/thread-sig



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4