Merging, and adding test project

This commit is contained in:
Taha authored and John Colvin committed 2023-09-30 12:52:37 -04:00
1 parent 9311c27f47
commit 404698152e
13 files changed
+717 -110

No files matched your search

+9 -12
View File
@@ -1,22 +1,22 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Linq;
//using BCG.Utilities;
//using BCG.Utilities.General;
namespace BCG
{
class PubSub2Main
{
namespace BCG {
class PubSub2Main {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main(string[] args)
{
public static async Task Main(string[] args) {
SimpleTCPServerAsync.start();
Task.Delay(1000000000).Wait();
if (args.Length > 0 && args[0] == "daemon")
args = args.Skip(1).ToArray();
@@ -26,14 +26,11 @@ namespace BCG
long currentMemory = 0;
int defaultWaitTime = 100;
bool gced = false;
new Thread(() =>
{
while (true)
{
new Thread(() => {
while (true) {
gced = false;
currentMemory = GC.GetTotalMemory(false);
if (config.PS3_GCActivationThreshold > 0 && currentMemory > config.PS3_GCActivationThreshold)
{
if (config.PS3_GCActivationThreshold > 0 && currentMemory > config.PS3_GCActivationThreshold) {
string gcMsg = String.Format("GCing memory, mem before GC = {0}", currentMemory);
// BlueEventLog.logEvent(gcMsg, PS3LogLevels.info);
Console.WriteLine(gcMsg);