TS-4265: Thread initialization update.#3
Conversation
| } | ||
| return false; | ||
| auto &tg = eventProcessor.thread_group[ET_CLUSTER]; | ||
| return ET_CLUSTER && std::any_of(tg._thread, tg._thread + tg._count, [et](EThread *t) { return t == et; }); |
There was a problem hiding this comment.
When is it valid that a thread in the ET_CLUSTER thread_group not be of type ET_CLUSTER?
There was a problem hiding this comment.
That's how the current code works. The type is a bit mask. But more realistically, it's cluster code, it should never be called. But I might want to put the ET_CLUSTER check first - if it's zero then the cluster group was never set up.
iocore/cache/I_Cache.h
Outdated
| } | ||
|
|
||
| virtual int start(int n_cache_threads = 0, size_t stacksize = DEFAULT_STACKSIZE); | ||
| virtual int start(int n_cache_threads = 0, size_t stacksize = DEFAULT_STACK_SIZE) override; |
There was a problem hiding this comment.
How come the name of the constant is changed to add an underscore but the variable name is not?
There was a problem hiding this comment.
Heh. I'll look at that.
|
|
||
| /// Convenience overload. | ||
| /// This registers @a name as an event type using @c registerEventType and then calls the real @c spawn_event_threads | ||
| EventType spawn_event_threads(const char *name, int n_thread, size_t stacksize = DEFAULT_STACK_SIZE); |
There was a problem hiding this comment.
It's handy in several places.
| eventProcessor.spawn_event_threads(ET_GROUP, n_group_threads, GROUP_STACK_SIZE); | ||
|
|
||
|
|
||
| The function :code:`Group_Thread_Init` can be replaced with a continuation if that's more convenient. One advantage of a continuation is additional data (via :arg:`cookie`) can be provide during thread initialization. |
There was a problem hiding this comment.
Is edata being replaced with cookie? Seems like a name collision to use cookie.
There was a problem hiding this comment.
I was mixed about that. It's called a cookie in the Event structure, which is where the argument name comes from.
iocore/eventsystem/UnixEThread.cc
Outdated
| signal_hook(nullptr), | ||
| tt(att), | ||
| server_session_pool(nullptr) | ||
| EThread::EThread(ThreadType att, int anid) : id(anid), tt(att), server_session_pool(NULL) |
There was a problem hiding this comment.
Because this was done initially before the Great Null Shift and I missed this during the merge.
| /// Set the affinity for the current thread. | ||
| int set_affinity(int, Event *); | ||
|
|
||
| #if defined(HAVE_HWLOC_OBJ_PU) |
There was a problem hiding this comment.
Shouldn't this be #if defined(TS_USE_HWLOC)?
| Debug("iocore_thread", "EThread: %d %s: %d CPU Mask: %s\n", i, _name, obj->logical_index, cpu_mask); | ||
| #else | ||
| Debug("iocore_thread", "EThread: %d %s: %d", i, obj_name, obj->logical_index); | ||
| Debug("iocore_thread", "EThread: %d %s: %d\n", i, _name, obj->logical_index); |
Standardize error messages by removing the terminating period.
Coverity 1199997 Coverity 1200000 Coverity 1200003 Coverity 1200012
This also undoes a previous change, that hopefully the new model rule will take care of (instead of nesting the if/else).
The name of this type is misspelled in the documentation. Signed-off-by: David Calavera <david.calavera@gmail.com>
This is for the GNU indent tool, which has been superseded by clang-format.
Let's use some C++11 features!
…ter. TS_LUA_CONFIG_HTTP_NEGATIVE_CACHING_LIFETIME was mapped to the wrong TS_CONFIG_... value. This patch corrects the mapping thus allowing the negative caching lifetime to be changed via the Lua plugin.
The file is empty so I don't think we need it.
Replaced all calls to do_io(VIO::ENUM, ...) with matching do_io_*(...).
The eventProcessor.spawn_thread() is used to create a DEDICATED EThread. The n_dthreads is total number of DEDICATED EThreads. When a new DEDICATED EThread created, it makes the `all_dthreads[n_dthreads]' point to the EThread object then do `n_dthreads++' It is not likes the spawn_event_threads() that only called from main() before any EThread runs. It is can be called from main() and/or any EThread. Therefore there is a race on accessing `all_dthreads[n_dthreads]' and `n_dthreads++'.
…or a valid request.
# This is the 1st commit message: BufferWriter: Formatting tweaks, updated documentation. # The commit message #2 will be skipped: # BufferWriterFormat: Add support for sockaddr and IpEndpoint. # The commit message #3 will be skipped: # BufferWriter: Cleanup pass. # Exchange align '^' and '=' to conform to documentation and Python spec.
Fix the `make check` failure with the following output by changing to .gold which meets our license exclusion regex rules: Printing headers for text files without a valid license header... ===================================================== == File: ./tests/gold_tests/records/gold/renamed_records.out ===================================================== ``` ┌■ 8 Renamed records: └┬──» #1 : proxy.config.output.logfile -> proxy.config.output.logfile.name ├──» #2 : proxy.config.exec_thread.autoconfig -> proxy.config.exec_thread.autoconfig.enabled ├──» #3 : proxy.config.hostdb -> proxy.config.hostdb.enabled ├──» #4 : proxy.config.tunnel.prewarm -> proxy.config.tunnel.prewarm.enabled ├──» #5 : proxy.config.ssl.origin_session_cache -> proxy.config.ssl.origin_session_cache.enabled ├──» #6 : proxy.config.ssl.session_cache -> proxy.config.ssl.session_cache.value ├──» #7 : proxy.config.ssl.TLSv1_3 -> proxy.config.ssl.TLSv1_3.enabled └──» #8 : proxy.config.ssl.client.TLSv1_3 -> proxy.config.ssl.client.TLSv1_3.enabled ```
No description provided.