Disabling Plugin threading #1

3 years ago

Avatar of xTrollxDudex
xTrollxDudex, Admin
Offline

I am considering removing low-level Thread access to plugins, a number of reasons justify this:

- Normally, one would use the scheduler to run tasks - it keeps tasks in sync and provides a thread pool which reduces thread lifecycle overhead

- Threads are most often abused or not used properly

- Threads interfere with Trident performance as it contends for core cycles

- Thread lifecycles blocks the thread which dispatches plugin events, degrading performance of other plugins

- 99% of plugin developers shouldn't use or don't need threads, the 1% that do know what a scheduler is

 

Are there any thoughts, comments, or disagreements to elaborate on this debate?

0

Disabling Plugin threading #2

3 years ago

Avatar of sothatsit
sothatsit, Member
Offline

How do you remove thread access to plugins? Just curious.

0

Disabling Plugin threading #3

3 years ago

Avatar of xTrollxDudex
xTrollxDudex, Admin
Offline

I could prevent access to public members using the SecurityManager's checkAccess method, and setting it to apply to the plugin threads.

0

Disabling Plugin threading #4

3 years ago

Avatar of sidboy55555
sidboy55555, Member
Offline

Maybe you can set it on the count of plugins? like 1-10 plugins 1 thread exemple, 10-20 plugins 2 threads, 20-30 plugins 3 threads etc.

0

Disabling Plugin threading #5

3 years ago

Avatar of xTrollxDudex
xTrollxDudex, Admin
Offline

Since the number of plugins allowed is infinite, it's difficult to determine both the platform, memory, and plugins that will take that much resources. It's best to simply stay with the scheduler's fixed 3 threads in order to prevent plugins from interfering with the server's performance.

0
Copyright © 2018 TridentSDK
Made by Vilsol