aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2017-06-13 19:04:18 +0100
committerUbitUmarov2017-06-13 19:04:18 +0100
commitad43cc6784b5422c5b7125a4f9356a3fa7fe2aee (patch)
tree59b8555f11cebc65a15ac2807037187a3a27a879 /OpenSim/Region
parentmake JobEngine be a workitem of mail pool (smartThread), with the option to r... (diff)
downloadopensim-SC-ad43cc6784b5422c5b7125a4f9356a3fa7fe2aee.zip
opensim-SC-ad43cc6784b5422c5b7125a4f9356a3fa7fe2aee.tar.gz
opensim-SC-ad43cc6784b5422c5b7125a4f9356a3fa7fe2aee.tar.bz2
opensim-SC-ad43cc6784b5422c5b7125a4f9356a3fa7fe2aee.tar.xz
change llclient async udp packets processing. Removed the shared Jobengine that made only one thread do some packets for all users, and removed the FireAndForget, so each user could issue a unlimited number of threads. Added a new JobEngine per client, so each gets at most one thread,and that thread can be released if iddle (for 5 seconds )
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs12
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs14
2 files changed, 15 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index d22f75e..54359eb 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -325,6 +325,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
325 /// </summary> 325 /// </summary>
326 public LLImageManager ImageManager { get; private set; } 326 public LLImageManager ImageManager { get; private set; }
327 327
328 public JobEngine m_asyncPacketProcess;
328 private readonly LLUDPServer m_udpServer; 329 private readonly LLUDPServer m_udpServer;
329 private readonly LLUDPClient m_udpClient; 330 private readonly LLUDPClient m_udpClient;
330 private readonly UUID m_sessionId; 331 private readonly UUID m_sessionId;
@@ -378,7 +379,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
378 protected Scene m_scene; 379 protected Scene m_scene;
379 protected string m_firstName; 380 protected string m_firstName;
380 protected string m_lastName; 381 protected string m_lastName;
381 protected Thread m_clientThread;
382 protected Vector3 m_startpos; 382 protected Vector3 m_startpos;
383 protected UUID m_activeGroupID; 383 protected UUID m_activeGroupID;
384 protected string m_activeGroupName = String.Empty; 384 protected string m_activeGroupName = String.Empty;
@@ -529,7 +529,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
529 m_prioritizer = new Prioritizer(m_scene); 529 m_prioritizer = new Prioritizer(m_scene);
530 530
531 RegisterLocalPacketHandlers(); 531 RegisterLocalPacketHandlers();
532 532 string name = string.Format("AsyncInUDP-{0}",m_agentId.ToString());
533 m_asyncPacketProcess = new JobEngine(name, name, 10000);
533 IsActive = true; 534 IsActive = true;
534 } 535 }
535 536
@@ -592,6 +593,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
592 if (OnConnectionClosed != null) 593 if (OnConnectionClosed != null)
593 OnConnectionClosed(this); 594 OnConnectionClosed(this);
594 595
596 m_asyncPacketProcess.Stop();
595 597
596 // Flush all of the packets out of the UDP server for this client 598 // Flush all of the packets out of the UDP server for this client
597 if (m_udpServer != null) 599 if (m_udpServer != null)
@@ -778,12 +780,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
778 cinfo.AsyncRequests[packet.Type.ToString()]++; 780 cinfo.AsyncRequests[packet.Type.ToString()]++;
779 781
780 object obj = new AsyncPacketProcess(this, pprocessor.method, packet); 782 object obj = new AsyncPacketProcess(this, pprocessor.method, packet);
781 783/*
782 if (pprocessor.InEngine) 784 if (pprocessor.InEngine)
783 m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); 785 m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj));
784 else 786 else
785 Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString()); 787 Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString());
786 788*/
789 m_asyncPacketProcess.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj));
787 result = true; 790 result = true;
788 } 791 }
789 else 792 else
@@ -841,6 +844,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
841 844
842 public virtual void Start() 845 public virtual void Start()
843 { 846 {
847 m_asyncPacketProcess.Start();
844 m_scene.AddNewAgent(this, PresenceType.User); 848 m_scene.AddNewAgent(this, PresenceType.User);
845 849
846// RefreshGroupMembership(); 850// RefreshGroupMembership();
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 171e1cf..b575ed9 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -414,7 +414,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
414 /// Queue some low priority but potentially high volume async requests so that they don't overwhelm available 414 /// Queue some low priority but potentially high volume async requests so that they don't overwhelm available
415 /// threadpool threads. 415 /// threadpool threads.
416 /// </summary> 416 /// </summary>
417 public JobEngine IpahEngine { get; protected set; } 417// public JobEngine IpahEngine { get; protected set; }
418 418
419 /// <summary> 419 /// <summary>
420 /// Run queue empty processing within a single persistent thread. 420 /// Run queue empty processing within a single persistent thread.
@@ -527,7 +527,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
527 { 527 {
528 StartInbound(); 528 StartInbound();
529 StartOutbound(); 529 StartOutbound();
530 IpahEngine.Start(); 530// IpahEngine.Start();
531 OqrEngine.Start(); 531 OqrEngine.Start();
532 532
533 m_elapsedMSSinceLastStatReport = Environment.TickCount; 533 m_elapsedMSSinceLastStatReport = Environment.TickCount;
@@ -572,7 +572,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
572 m_log.Info("[LLUDPSERVER]: Shutting down the LLUDP server for " + Scene.Name); 572 m_log.Info("[LLUDPSERVER]: Shutting down the LLUDP server for " + Scene.Name);
573 base.StopOutbound(); 573 base.StopOutbound();
574 base.StopInbound(); 574 base.StopInbound();
575 IpahEngine.Stop(); 575// IpahEngine.Stop();
576 OqrEngine.Stop(); 576 OqrEngine.Stop();
577 } 577 }
578 578
@@ -691,12 +691,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
691 691
692 Scene = (Scene)scene; 692 Scene = (Scene)scene;
693 m_location = new Location(Scene.RegionInfo.RegionHandle); 693 m_location = new Location(Scene.RegionInfo.RegionHandle);
694 694/*
695 IpahEngine 695 IpahEngine
696 = new JobEngine( 696 = new JobEngine(
697 string.Format("Incoming Packet Async Handling Engine ({0})", Scene.Name), 697 string.Format("Incoming Packet Async Handling Engine ({0})", Scene.Name),
698 "INCOMING PACKET ASYNC HANDLING ENGINE"); 698 "INCOMING PACKET ASYNC HANDLING ENGINE");
699 699*/
700 OqrEngine 700 OqrEngine
701 = new JobEngine( 701 = new JobEngine(
702 string.Format("Outgoing Queue Refill Engine ({0})", Scene.Name), 702 string.Format("Outgoing Queue Refill Engine ({0})", Scene.Name),
@@ -781,7 +781,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
781 MeasuresOfInterest.AverageChangeOverTime, 781 MeasuresOfInterest.AverageChangeOverTime,
782 stat => stat.Value = GetTotalQueuedOutgoingPackets(), 782 stat => stat.Value = GetTotalQueuedOutgoingPackets(),
783 StatVerbosity.Info)); 783 StatVerbosity.Info));
784 784/*
785 StatsManager.RegisterStat( 785 StatsManager.RegisterStat(
786 new Stat( 786 new Stat(
787 "IncomingPacketAsyncRequestsWaiting", 787 "IncomingPacketAsyncRequestsWaiting",
@@ -794,7 +794,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
794 MeasuresOfInterest.None, 794 MeasuresOfInterest.None,
795 stat => stat.Value = IpahEngine.JobsWaiting, 795 stat => stat.Value = IpahEngine.JobsWaiting,
796 StatVerbosity.Debug)); 796 StatVerbosity.Debug));
797 797*/
798 StatsManager.RegisterStat( 798 StatsManager.RegisterStat(
799 new Stat( 799 new Stat(
800 "OQRERequestsWaiting", 800 "OQRERequestsWaiting",