Skip to content

Commit

Permalink
Remove un-used C++ thread pool properties (zeroc-ice#2804)
Browse files Browse the repository at this point in the history
[name].ThreadPool.ThreadPriority
[name].ThreadPool.StackSize
Ice.ThreadPriority
  • Loading branch information
externl authored Sep 27, 2024
1 parent 9097a09 commit 006580b
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 45 deletions.
5 changes: 1 addition & 4 deletions config/PropertyNames.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,9 @@ generated from the section label.
<suffix name="Size" languages="cpp,csharp,java" default="1" />
<suffix name="SizeMax" languages="cpp,csharp,java" />
<suffix name="SizeWarn" languages="cpp,csharp,java" default="0" />
<!-- TODO: remove from c++ -->
<suffix name="StackSize" languages="csharp,java" default="0" />
<suffix name="Serialize" languages="cpp,csharp,java" default="0" />
<suffix name="ThreadIdleTime" languages="cpp,csharp,java" default="60" />
<!-- TODO: remove from c++ -->
<suffix name="ThreadPriority" languages="csharp,java" />
</class>

Expand Down Expand Up @@ -313,8 +311,7 @@ generated from the section label.
<property name="SyslogFacility" languages="cpp,java" default="LOG_USER" />
<property name="ThreadPool.Client" class="threadpool" languages="cpp,csharp,java" />
<property name="ThreadPool.Server" class="threadpool" languages="cpp,csharp,java" />
<!-- TODO: remove from c++ -->
<property name="ThreadPriority" languages="cpp,csharp,java" />
<property name="ThreadPriority" languages="csharp,java" />
<property name="ToStringMode" languages="all" default="Unicode" />
<property name="Trace.Admin.Properties" languages="cpp,csharp,java" default="0" />
<property name="Trace.Admin.Logger" languages="cpp,csharp,java" default="0" />
Expand Down
4 changes: 1 addition & 3 deletions cpp/src/Ice/ObjectAdapterI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1439,9 +1439,7 @@ Ice::ObjectAdapterI::filterProperties(StringSeq& unknownProps)
"ThreadPool.Size",
"ThreadPool.SizeMax",
"ThreadPool.SizeWarn",
"ThreadPool.StackSize",
"ThreadPool.ThreadIdleTime",
"ThreadPool.ThreadPriority"};
"ThreadPool.ThreadIdleTime"};

//
// Do not create unknown properties list if Ice prefix, ie Ice, Glacier2, etc
Expand Down
3 changes: 1 addition & 2 deletions cpp/src/Ice/PropertyNames.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) ZeroC, Inc.

// Generated by makeprops.py from PropertyNames.xml, Thu Sep 26 14:57:25 2024
// Generated by makeprops.py from PropertyNames.xml, Fri Sep 27 11:15:19 2024

// IMPORTANT: Do not edit this file -- any edits made here will be lost!

Expand Down Expand Up @@ -140,7 +140,6 @@ const IceInternal::Property IcePropsData[] =
IceInternal::Property("Ice.ThreadPool.Server.SizeWarn", false, "0", false),
IceInternal::Property("Ice.ThreadPool.Server.Serialize", false, "0", false),
IceInternal::Property("Ice.ThreadPool.Server.ThreadIdleTime", false, "60", false),
IceInternal::Property("Ice.ThreadPriority", false, "", false),
IceInternal::Property("Ice.ToStringMode", false, "Unicode", false),
IceInternal::Property("Ice.Trace.Admin.Properties", false, "0", false),
IceInternal::Property("Ice.Trace.Admin.Logger", false, "0", false),
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/Ice/PropertyNames.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) ZeroC, Inc.

// Generated by makeprops.py from PropertyNames.xml, Thu Sep 26 14:57:25 2024
// Generated by makeprops.py from PropertyNames.xml, Fri Sep 27 11:15:19 2024

// IMPORTANT: Do not edit this file -- any edits made here will be lost!

Expand Down
29 changes: 0 additions & 29 deletions cpp/src/Ice/ThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,8 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p
_sizeMax(0),
_sizeWarn(0),
_serialize(_instance->initializationData().properties->getPropertyAsInt(_prefix + ".Serialize") > 0),
_hasPriority(false),
_priority(0),
_serverIdleTime(timeout),
_threadIdleTime(0),
_stackSize(0),
_inUse(0),
#if !defined(ICE_USE_IOCP)
_inUseIO(0),
Expand Down Expand Up @@ -254,32 +251,6 @@ IceInternal::ThreadPool::initialize()
_selector.setup(_sizeIO);
#endif

#if defined(__APPLE__)
//
// We use a default stack size of 1MB on macOS. The C++ mapping allows transmitting
// class graphs with a depth of 100 (maximum default), 512KB is not enough otherwise.
//
int defaultStackSize = 1024 * 1024; // 1MB
#else
int defaultStackSize = 0;
#endif
int stackSize = properties->getPropertyAsIntWithDefault(_prefix + ".StackSize", defaultStackSize);
if (stackSize < 0)
{
Warning out(_instance->initializationData().logger);
out << _prefix << ".StackSize < 0; Size adjusted to OS default";
stackSize = 0;
}
const_cast<size_t&>(_stackSize) = static_cast<size_t>(stackSize);

const_cast<bool&>(_hasPriority) = properties->getProperty(_prefix + ".ThreadPriority") != "";
const_cast<int&>(_priority) = properties->getPropertyAsInt(_prefix + ".ThreadPriority");
if (!_hasPriority)
{
const_cast<bool&>(_hasPriority) = properties->getProperty("Ice.ThreadPriority") != "";
const_cast<int&>(_priority) = properties->getPropertyAsInt("Ice.ThreadPriority");
}

_workQueue = make_shared<ThreadPoolWorkQueue>(*this);
_selector.initialize(_workQueue.get());

Expand Down
3 changes: 0 additions & 3 deletions cpp/src/Ice/ThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,8 @@ namespace IceInternal
const int _sizeMax; // Maximum number of threads.
const int _sizeWarn; // If _inUse reaches _sizeWarn, a "low on threads" warning will be printed.
const bool _serialize; // True if requests need to be serialized over the connection.
const bool _hasPriority;
const int _priority;
const int _serverIdleTime;
const int _threadIdleTime;
const size_t _stackSize;

std::set<EventHandlerThreadPtr> _threads; // All threads, running or not.
int _inUse; // Number of threads that are currently in use.
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/Ice/Internal/PropertyNames.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) ZeroC, Inc.

// Generated by makeprops.py from PropertyNames.xml, Thu Sep 26 14:57:25 2024
// Generated by makeprops.py from PropertyNames.xml, Fri Sep 27 11:15:19 2024

// IMPORTANT: Do not edit this file -- any edits made here will be lost!

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) ZeroC, Inc.

// Generated by makeprops.py from PropertyNames.xml, Thu Sep 26 14:57:25 2024
// Generated by makeprops.py from PropertyNames.xml, Fri Sep 27 11:15:19 2024

// IMPORTANT: Do not edit this file -- any edits made here will be lost!

Expand Down
2 changes: 1 addition & 1 deletion js/src/Ice/PropertyNames.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) ZeroC, Inc.

// Generated by makeprops.py from PropertyNames.xml, Thu Sep 26 14:57:25 2024
// Generated by makeprops.py from PropertyNames.xml, Fri Sep 27 11:15:19 2024

// IMPORTANT: Do not edit this file -- any edits made here will be lost!

Expand Down

0 comments on commit 006580b

Please sign in to comment.