VS 2008 Program Logic With Threading

Nov 22, 2010

I have an application that I need to automate where at a certain time each day, say 6pm, it will run a certain method(which is to check a database for key terms and then access the api to search for these terms). But there is the main process which is running all the time accessing the stream api so when the search is complete, it interrupts the stream and hands over the new terms. Now I thought of adding the .exe file to windows task scheduler but not sure if that would work. The stream method runs indefinitely and at 6pm each day another process needs to run. I thought of using the system.threading.task TaskFactory but I am using visual studio 2008 ( I do have .net framework 4.0)If it launches using the task scheduler as 6pm with my code logic as follows:[code]

I see how this would eat the CPU...the streaming process is basically following a list of user profiles listening for new activites and storing these as XML files. This a real time feed to an API. At a specific time once a day, a second process needs to go access a database for new ids, and if there are new ids, then go to a search API and get new user profiles. This is the main criteria..once the new user profiles are found, the list that the stream users needs to be updated so the process will be interrupted for a second or just paused and then continue processing.

View 10 Replies


ADVERTISEMENT

C# - (.net) Logging The Function Logic Of Program?

Jul 22, 2009

I'd like for debugging purposes to be able to log what functions are called and in what order. So I've been just putting Debug.WriteLine("myFunctionName(args)") all over my functions, logging it in the end to a file. Isn't there a better approach to do this?

View 4 Replies

Program Logic To Speed Up Processing?

Oct 11, 2009

I have setup an application to parse about 3000 files a day where each contains around 4000-5000 posts in xml format with like 100 fields.It involves a lot of cleanup and parsing but on average it takes around 6 seconds per post.Now I tried threading but because of the way I have everything set up with variables being overwritten etc...I have divided the files into different folders and just created copies of the program to run and access the assigned folder. It is running on a windows 2008 server with 16 G of memory and I am told I need to reprogram to speed up the process and also not use so much memory.

For i As Integer = 0 To fileLists.Count - 1
Do
Try

[code].....

View 2 Replies

C# - Changing Program Logic To Accommodate New Retail Tax Law?

Jul 23, 2010

Background: I have a program that has implemented the two "classic" taxes for Ontario Canada: 5% GST and 8% PST. At the beginning of July (2010) the province switched to one combined HST tax of 13% for the most part. Effects and changes here but those aren't the main point of this question...

Question: What are best practices and good solutions to accommodate for future changes easily in retail taxes? Tax changes occur often enough. I'm sure there are a many SO users with good experience.

View 2 Replies

VS 2010 Program Logic To Speed Up Processing

Mar 29, 2011

I have setup an application to parse about 3000 files a day where each contains around 4000-5000 posts in xml format with like 100 fields. It involves a lot of cleanup and parsing but on average it takes around 6 seconds per post. Now I tried threading but because of the way I have everything set up with variables being overwritten etc...I have divided the files into different folders and just created copies of the program to run and access the assigned folder. It is running on a windows 2008 server with 16 G of memory and I am told I need to reprogram to speed up the process and also not use so much memory.

[Code]...

View 3 Replies

Gradually Transition To NHibernate Persistence Logic From Existing ADO.NET Persistence Logic?

Sep 3, 2010

The application uses ADO.NET to invoke sprocs for nearly every database operation. Some of these sprocs also contain a fair amount of domain logic. The data access logic for each domain entity resides in the domain class itself. ie, there is no decoupling between domain logic and data access logic. I'm looking to accomplish the following:

[Code]...

View 2 Replies

Threading Makes My Program Not Responding?

Feb 12, 2012

here is my script:

Private Sub UpdateThread()
Dim AppDir As String = Application.StartupPath()
My.Computer.Network.DownloadFile(MyUpdate.UpdateFetchURL,

[Code]...

It does perfectly the UpdateThread task, but program just hangs.

View 1 Replies

VS 2008 Logic With Days

Oct 7, 2009

We have a system were a user chooses a combination of days from a calander. We then insert a values in the databse based on the following [code]So if they picked Monday and Friday we would insert 34, or if they picked Monday,Tuesday and Thursday we would insert 22.Now my question is how do I reverse this easily in code, to find out what days they have picked. So I get fed 22 from the database how do I figure out what combination of days make up that value. The only thing I can think of is creating the mother of all case statements but I know there must be a better way.

View 4 Replies

VS 2008 Access To DataGridView For Logic Operation?

Nov 22, 2009

I have created a DB connection, loaded my data grid and am looking to perform accumulation on the salaries that are shown. However it won't give me access to my grid view or the table for the Row.

This is the code that I have. The loop and the accumulator is at the bottom.

If rdoFullTime.Checked = True Then
'Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data3

[Code]....

I tried to dim the Row as myDA.Row and myDataSet.Row and it won't allow me to and I can't figure out why. I know this deals with database but the problem is the logic not the database.

View 4 Replies

VS 2008 DGV Display A Column Based On Logic?

Jan 12, 2010

I have a DGV which is part of an inventory system. I have several columns but the ones i need to resolve are Quantity, Name and Plural Name. essentially if quantity is 1 i need to display the Name data if greater than one the plural data. Is this possible? would i need to resolve this earlier in the process (the data is extracted from an xml file using LINQ to bind it to a rowObject) or can i do this with the completed dataset, say by hiding the Name and Plural Name colums and creating a custom column? ideally i would like to keep the data untouched.

View 10 Replies

Cross Threading Operations In VB 2008?

Oct 27, 2010

I'm using Visual Basic 2010I've created a ListBox and a BackgroundWorker using designerI want to change the location of listbox using backgroundworker but I get the error as follows:"InvalidOperationException was Handled by user code:"Cross-thread operation not valid: Control 'ListBox1' accessed from a thread other than the thread it was created on

View 10 Replies

Serial Communication Using Threading In 2008?

Jul 5, 2009

how to do serial communication using threading in vb.net 2008,

View 1 Replies

VS 2008 Memory Management & Threading?

Sep 28, 2010

I have an application that requires the use of many threads. How do i monitor the memory consumption of my application?And how can i monitor the CPU usage of my application if possible?And is it possible to monitor the memory consumtion and CPU usage of each of these threads?And is it possible to limit or prioritize the memory consuption or cpu usage of the whole application or of each thread?

View 5 Replies

VS 2008 Multi Threading Query?

Apr 22, 2009

after i get a successful ping response i need to send an HTTP request to the device examine the response and then display it. i'm trying to multi thread the 2nd bit with no joy so far.

Imports System.Net
Imports System.Net.NetworkInformation
Imports System.Threading

[code].....

View 2 Replies

VS 2008 Multi-Threading With More Than Two Threads?

Jun 5, 2009

I would like some advice on multi-threading. I currently utilize two threads, one for the GUI, and the other for calculations. This works well, but I want to improve my multi-threading techniques. Currently the data is with the calculation thread, and this occasionally this will cause a slow down. I want to put the data on its own thread. Giving me three threads, Data, UI, and Calculations. This should improve responsiveness, and not be overwhelmingly complex.

My problem is, this no longer fits into the parent child relationship well. All three threads need to interact with each other. My question is, what is the better way of dealing with more than two threads, when all the threads need to interact with each other. Should I pick one thread as the ultimate parent, say the data thread (I pick this one, because it seems to me this thread will be the most free.) Then have the calculation thread and the UI thread children of the data thread. Then when I have a need for the UI thread to explicitly call the calculation thread, I do this through a function in the data thread.

View 2 Replies

VS 2008 Process Cancellation And Threading?

Dec 8, 2009

I have an application I'm working on that is essentially an Excel workbook generator (special input files for our wireshop machinery). Therefore, it's process is lengthy.

Is it possible to build a Cancel feature while it is looping through its collections to process these files?

If so, would I need to implement multi-threading?

View 15 Replies

VS 2008 System.Threading.ManualResetEvent?

Oct 28, 2009

I'm just looking for other people's thoughts and opinions on the way I have done something.I have a console application which needs to connect to various computers and reset the local admin password on each one. I got it all working but then decided that as there are a lot of PCs, it would be a good idea to use the thread pool to do a few at the same time.The problem is, I need this program to be run without any human interaction - so I cant just use ThreadPool.QueueUserWorkItem and pass it all of the computers to connect to, because then the program would exit after it had called QueueUserWorkItem for each one because there is nothing left for it to do. I cant stick a Console.ReadLine in there because like I said, it needs to be run automatically without anyone typing anything.

View 1 Replies

VS 2008 TCP Client/Server Threading?

Nov 11, 2009

Is is possible for the server to give all clients that are connected to it a separate threading starting from 1-2-3-etc that will be display there username on a listview. Server can now connect to any of them by clicking on one of the items in the listview.

EX: Multi-Clients Connect to server ---> Server gives each one a separate thread starting with 1 ----> Client sends username to server -----> Server displays them on listview ---> Server can now double click or whatever on the item ---> Pulles up thread count and connects to it.

View 1 Replies

VS 2008 - Multi Threading - Error Code

Oct 11, 2011

Wheres my error on this code...

Imports System.Net
Imports System.Threading
Public Class Form1

[CODE]...........

Basically what I want to do is that User will select how many thread w/c is the PickThread.value, then it will do the stuff.

View 11 Replies

VS 2008 : Threading.Thread.Sleep Won't Work

Mar 13, 2010

i got inside

WebBrowser1_DocumentCompleted sub

the code below

WebBrowser1.Document.GetElementById("form").InvokeMember("click")
Call ProcessNextLine()

when it clicks this button it should load another page(Like log in)

Call ProcessNextLine()
takes next line from txt file (It's url) + navigate

but I want it to wait let the page load before calling "Call ProcessNextLine()" I tried System.Threading.Thread.Sleep not working?

View 12 Replies

VS 2008 BackgroundWorker1 Or System.Threading.Thread

Apr 25, 2012

What is the difference in using: BackgroundWorker1 or System.Threading.Thread

View 3 Replies

VS 2008 Get System.Threading.Timer To Work

Sep 27, 2011

Trying to get System.Threading.Timer to work!! I am converting a small form based application to run as a services, The app just runs an monitors a folder and then when it finds a file to does some work on it. Having changed the form.timer to threading.timmer - The timer stopps working after a while. Below is a simple test services - when you look in to the text file it stops after approx 130 entries

[Code]...

View 1 Replies

VS 2008 Mutli-Threading/Sockets Chat?

Sep 6, 2009

How do I make a chat room that multi clients will be connecting to at once. Im trying to add a ping/pong method which is just msgbox that tells the user if the message was received. I know that you need a background worker for this but how do i handle all the msgs that are going back and forth to all the clients that are connected to the server

View 1 Replies

VS 2008 Simple Threading But Strange Error

Dec 21, 2011

i have tryed using multithreading with my program with no luck/I just get a strange error thrown at me no matter what i try [code] Then i get this error:An error occurred creating the form. See Exception.InnerException for details. The error is: ActiveX control '6bf52a52-394a-11d3-b153-00c04f79faa6' cannot be instantiated because the current thread is not in a single-threaded apartment.

View 13 Replies

VS 2008 Threading + Form.Show() Hanging?

Feb 23, 2010

I'm not sure how to explain what's happening but it seems to be deadlock, i did search along the forum and actualy did find who had the same problem as i did. Unfortunatly i'm too new to this Threading and could not understand why does this deadlocks happen or how to avoid them.I'm using the following

Dim t As New Threading.Thread(AddressOf MyTestingSub)
t.Priority = Threading.ThreadPriority.BelowNormal
t.IsBackground = True

[code].....

View 6 Replies

VS 2008 What Are Usages For Threading Or BackgroundWorker And Their Implementations

Aug 11, 2009

I would like to know what are the usages for Threading or BackgroundWorker, and their implementations.I currently am running a UDP program, but the server freezes until the client sends the packet, which momentarily unfreezes the server, and then re freezes it.I have looked at the MSDN for them and they seem complicated :l

View 26 Replies

VS 2008 [Multi-threading] How To Run This Code In A Separate Thread

Apr 21, 2009

I am creating an IDE for a game script with similar functionality as the Visual Studio IDE (at least, some of it). The game script consist of code that looks visually a bit like C code. It uses braces to define the start and end of a 'class' and uses nested braces to define the start and end of an 'event' in a class.

What I want finally is to have two Comboboxes above the text editor, one that lists each Class and the other listing each Event. The comboboxes should also show the Class and Event that the caret is currently in, just like in Visual Studio.I have attached an example of such a script (you can open it with Notepad).However, here is a short example where you can also see how I "defined" classes and events:

class1
{
event1
{

[code]....

As you can see, the classes are the 'names' of each block of code, defined by matching braces { }. The events are the names of each nested block of code, also defined by matching braces { } but inside a class. There is only one level of nesting.As you can also see, the layout can follow the standard C-style layout, or a slightly different layout (using the opening brace on the same line as the class/event name), or even a completely chaotic mess. As long as the braces match correctly, the code is valid.So in short, the large blocks are classes, while the nested blocks are events.

What I want to do, is parse an entire script, and store all the Classes (and eventually, also all the Events, but let's forget about them for now). I want to store the Class name, start position (defined as the start index of the name), end position (defined as the index of the closing brace) and the full text (defined as the text between start and end position, so including the name).

vb.net
Public Class clsClass
Private _Name As String

[code]....

The code works basically by finding every first opening brace (the opening brace of each CLASS, not event), and then loops through the class (using a brace counter to keep track of the nested braces) until it found the last closing brace. It then stores the name, start, end and fulltext in a new clsClass and adds it to the list to return.

View 3 Replies

VS 2008 - Multi-Threading - Code That Will Need To Be Repeated But With A Chance Of It Overlapping

Jul 29, 2009

Multi-Threading. I have got a simple bit of code that will need to be repeated but with a chance of it overlapping the only complex bit is there will be a varible that will be different each time. so I was wondering if I put it in another Thread and store the varible within the thread code would that achieve what I am looking for? To make it slightly easyier once the thread is started and pulled the Varible in there will be no cross talking between the thread and main app thread (ie no progress reports, no aborts/suspends etc) Nothing will be feeding back on thread completion either, when it ends it ends.

This is what I have so far:

Imports System.IO
Imports System.Threading

[CODE]...........................

View 5 Replies

VS 2008 System.Threading.Thread.Sleep Doesnt Work

Aug 22, 2009

I cant get System.Threading.Thread.Sleep to work..[code]

View 2 Replies

VS 2008 UI Threading - Move/interact With Both Forms While The Loop Is Running ?

Oct 17, 2009

When it comes to threading. I've managed to adapt one of JMcIllhinney's backgroundworker codebank examples to somewhat suit my needs, but not completely. I have a main form, and a second form that appears while I'm running through a for loop. It informs the user what is currently happening. I set up a backgroundworker that allowed me to continue to use the main form during the for loop, but the other "status" form was completely frozen, and any labels or graphics were shown as white boxes. I am struggling to figure out how to be able to move/interact with both forms while the loop is running.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved