473,750 Members | 2,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

migration single processor to dual processor problem

Hello,

I have an application, that has been running on a single processor server
for more then a year without any problems. Now I'm migrating to a dual
processor server, and I'm experiencing problems with threading.

The application is actually a kind of job schedular. For all jobs, I can set
a recurring interval (daily,weekly, monthly etc) at which the specific job
should be started. We program each job, according to an interface. Examples
of jobs are: server monitoring, reporting, messaging etc.

The job itself maintains a status. When it's complete, it's status is set to
ready.

The job-schedular looks at certain times for two things: Should I start a
new job and Is there a job with status Ready which should be stopped.

the code for stopping a job is only a:
ji.InstanceThre ad.Abort();
ji.InstanceThre ad.Join(1000);
MJSJobList._job List.Remove(ji) ;
What I now see, is that on the single processor server, this works, and the
job is removed from the list.
On the dual-processor server, however the job remains in the list with
status "Ready"..

Am I missing somethinge here ? The code worked perfectly on the other server
for a very long time.

Thanks in advance,
Michel Meex

Jun 12 '06 #1
1 1400
Ok, here's some more code.

In the windows service, a timer executes the following method:
internal void MonitorJobs()
{
ArrayList al = this.RetrieveJo bsState();
foreach(MJSJobS tate js in al)
{
//If job is ready
if (js.JobState == MJSJobStatic.Jo bState.Ready)
{
TempLogging(js. JobName,"Job found, status ready, should stop");
bool _found = false;
//stop and clear job
foreach (MJSJobInstance ji in MJSJobList._job List)
{
if (ji.JobData.Job Name == js.JobName)
{
_found = true;
this.JobStop(ji .JobData);
break; }
}
TempLogging(js. JobName,"Job found: " + _found.ToString ());
}
}
}

the method JobStop contains the following:
public void JobStop(MJSJobD ata jobData)
{
if (jobData != null)
{
//if job is running
if (this.JobIsRunn ing(jobData) ==
MJSJobStatic.Th reeValueBool.Tr ue)
{
bool jobStopped = false;
//Find job instance in joblist
foreach (MJSJobInstance ji in MJSJobList._job List)
{
if (jobData != null)
{
if (jobData.JobNam e == ji.JobData.JobN ame)
{
//Call job stop method (IJob interface),
((IJob) ji.InstanceObje ct).Stop();
//Clear object reference
ji.InstanceObje ct = null;
//Stop process / end thread
ji.InstanceThre ad.Abort();
ji.InstanceThre ad.Join(1000);

//debugging info
HistoryData _tempHistoryNew = new HistoryData();
_tempHistoryNew .JobName = ji.JobData.JobN ame;
_tempHistoryNew .Type = MJSJobStatic.Hi storyType.Infor mation;
_tempHistoryNew .Time = System.DateTime .Now;
_tempHistoryNew .Extra = "trying to stop.....debug info";
JobHistory.Add( _tempHistoryNew );
//end debugging info

//Remove job from JobList
MJSJobList._job List.Remove(ji) ;
jobStopped = true;
break;
}
}
}

if (jobStopped)
{
//Log event
HistoryData _tempHistoryNew = new HistoryData();
_tempHistoryNew .JobName = jobData.JobName ;
_tempHistoryNew .Type = MJSJobStatic.Hi storyType.Infor mation;
_tempHistoryNew .Time = System.DateTime .Now;
_tempHistoryNew .Extra = JOB_STOPPED;
JobHistory.Add( _tempHistoryNew );
}
else
{
//Log event
HistoryData _tempHistoryNew = new HistoryData();
_tempHistoryNew .JobName = jobData.JobName ;
_tempHistoryNew .Type = MJSJobStatic.Hi storyType.Error ;
_tempHistoryNew .Time = System.DateTime .Now;
_tempHistoryNew .Extra = "Job could not be stopped.";
JobHistory.Add( _tempHistoryNew );
}
}
else
{
//Write something to the log
//Log event
HistoryData _tempHistoryNew = new HistoryData();
_tempHistoryNew .JobName = jobData.JobName ;
_tempHistoryNew .Type = MJSJobStatic.Hi storyType.Error ;
_tempHistoryNew .Time = System.DateTime .Now;
_tempHistoryNew .Extra = "Job could not be stopped. The job is not
running.";
JobHistory.Add( _tempHistoryNew );
}
}
else
{
//Write something to the log if running state of job could not be
determined
//Log event
HistoryData _tempHistoryNew = new HistoryData();
_tempHistoryNew .JobName = string.Empty;
_tempHistoryNew .Type = MJSJobStatic.Hi storyType.Error ;
_tempHistoryNew .Time = System.DateTime .Now;
_tempHistoryNew .Extra = "Job could not be stopped. No job provided.";
JobHistory.Add( _tempHistoryNew );
}
}

I hope you can do something with this..
Regards,
Michel

Jun 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
5832
by: Tomer Ben-David | last post by:
Hi I have a big j2ee appliction that was so forth run on a single cpu machine. I have tested it on a dual cpu machine, its running much slower (about X3 times slower). I know that synchronize code fragments (indirect ones as well, such as the fact that StringBuffer is synchronized) can make code run slower
1
3177
by: Frank | last post by:
Hi, we are using oracle clients (Release 9.0.1.0.1 - Production) on an NT4 (Service Pack6) computers. the server is a W2K, (Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production With the Partitioning option,JServer Release 9.0.1.1.1 - Production) machine. now we are going to update several of those client boxes to a dual processor board. - great thinking but they are randomly crashing to blues screen. okay it is ms but the old...
3
1441
by: Michel Meex | last post by:
Hello, I have an application, that has been running on a single processor server for more then a year without any problems. Now I'm migrating to a dual processor server, and I'm experiencing problems with threading. The application is actually a kind of job schedular. For all jobs, I can set a recurring interval (daily,weekly, monthly etc) at which the specific job should be started. We program each job, according to an interface....
1
1404
by: xtseeker | last post by:
We have a multi-threaded .NET application, the problem is that the previous programmer didn't care to have locks on the shared variables. Somehow the application doesn't end up in Locked state on a single CPU machine but I have tried running it on several dual core machines and it randomly freezes. I am searching for a quick-fix until I implement locks around all the shared variables in the entire application. Is there a way to bound the...
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.