[PATCH] RFC: Start discussion on class or classes for thread data in GCC multithreading effort

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] RFC: Start discussion on class or classes for thread data in GCC multithreading effort

Nicholas Krause
From: npkrause <[hidden email]>

This is not meant to be merged nor follow any GCC coding standards
but start the work discussed about multithreading GCC. The dicussion
or part of it is about using per thread versions of the shared
data structures. However this runs into three issues to my knowledge
and therefore need to be dicussed. Some of this was discussed at
Cauldron but Richard was not there so I would like his comments.
1. Stack Size in the pthread spec seems to be a limit of 16K but
can we assume more to allocate the rather large structures into the
thread TLS.
2. Does the data need to be around per GIMPLE passes or for the
whole compilation as if not I would suggest a set of different
classes per GIMPLE,RTL phases.
3. Are the data structures immutable outside of the creation of
the data or do we need to be able to change the data on the fly?

Signed-off-by: npkrause <[hidden email]>
---
 gcc/thread-data.c |  8 ++++++++
 gcc/thread-data.h | 28 ++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 gcc/thread-data.c
 create mode 100644 gcc/thread-data.h

diff --git a/gcc/thread-data.c b/gcc/thread-data.c
new file mode 100644
index 00000000000..d0fe4c5d511
--- /dev/null
+++ b/gcc/thread-data.c
@@ -0,0 +1,8 @@
+#include "thread-data.h"
+
+ThreadData::ThreadData() {
+
+}
+
+ThreadData::~ThreadData() {
+}
diff --git a/gcc/thread-data.h b/gcc/thread-data.h
new file mode 100644
index 00000000000..0c83846d046
--- /dev/null
+++ b/gcc/thread-data.h
@@ -0,0 +1,28 @@
+/* thread-data.h - Various declarations for data structures to be lauched
+   per thread as found in thread-data.c
+   Copyright (C) 1998-2019 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_THREAD_DATA_H
+#define GCC_THREAD_DATA_H
+
+class ThreadData {
+   public:
+ ThreadData();
+ ~ThreadData();
+}
--
2.20.1