Figuring Out Which Multithreading Approach To Utilize In Current Work Project?
Apr 25, 2012
figuring out which multithreading approach to utilize in my current work project. Since I've never written a multithreaded app in my life, this is all confusing and very overwhelming.I've been assigned to take over work on a control application for a piece of test equipment in my companies R&D lab. The program has to be able to send and receive serial communications with three different devices semi-concurrently. The original program was written in VB 6 (no multithreading) and I did plan on just modding it to work with the newer products that need to be tested until it posed a safety hazard when the UI locked up due to excessive serial communications during a test. This resulted in part of the tester hardware blowing up, so I decided to try rewriting the app in VB.Net as I'm more comfortable with it to begin with and because I thought multithreading might help solve this problem.
My plan was to send commands to the other pieces of equipment from the main app thread and spin the receiving ends off into their own threads so that the main thread wouldn't lock up when timing is critical. However, I've yet to come to terms with my options. To add to my problems, I need to display the received communications in separate rich text boxes as they're received while the data from one particular device needs to be parsed by the main program, but only the text that results from the most current test (I need the text box to contain all received data though).
So far, I've investigated delegates, handling the threads myself, and just began looking into BackgroundWorkers. I tried to use delegates earlier today, but couldn't figure out a way to update the text boxes. Would I need to use a call back function to do this since I can't do it in the body of the delegate function itself? The problem I see with handling threads myself is figuring out how to pass data back and forth between the thread and the rest of the program. BackgroundWorkers, as I said, I just started investigating so I'm not sure what to think about them yet.
I have a wierd problem with threading in an ASP.NET application. For some reason, when I run the code in the request thread, everything works as expected. But when I run it in a separate thread, nothing happens.This is verified by calling the below handler with the three flags "on", "off" and "larma" respectively - in the two first cases everything works, but in the latter nothing happens.[code]
I am working on a signout system I have a good start but am trying to solve a small problem.Signing out equipment I fill part of a form with student data from the dataset with Fillby, fill the other half with equipment data using Fillby1 I then save this combined data to my Access 2007 Database using a OleDb.OleDbConnection.
In my application, I have a MainWindow with a ToolStripProgressBar and a ToolStripStatusLabel.
This properties: Property ProgressBarPercantage() As Integer Implements BCSXPSearchTool.Presenter.IMainView.ProgressPercentage Get Return Me._progressbarpercentage [Code] .....
The code above is working. But if I change the sub runproc() to: Public Sub runproc() Dim statusToSub As delegateStatusTo = AddressOf statusTo Dim percToSub As delegatePercTo = AddressOf percTo ' statusToSub.Invoke("Test") percToSub.Invoke(50) End Sub
It doesn't work. I get an exception: InvalidOperationException
I got the text something like: The access to the control, created by another thread from another thread is not allowed. I'm using Visual Studio 2008 Express + VB 2.0.
I have been trying to create good multithreading programs and it is not working well considering the use of global variables, local variables etc and thread safe controls. I have not found a good way of doing it since it seemed to be not as efficient as just running it on a single thread.
The program accesses facebook and twitter api, parses etc. and I am wondering if I can just create new tasks and map the program project file and fire new instances of the project. Someone this using the taskfactory in 2010 but I thought this was just the same as the threadpool. on this: create windows services and set them to run on task scheduler??
I'm in a beginner programming logic and technique class that also teaches us VB, and I'm working on a program that is to simulate total theater revenue, that asks for the number of tickets sold in a particular section and then displays the amount of sales generated from that section. It needs to validate that the total number of tickets sold is not over the maximum seating in that section.[code]
1) I have a warning that "Variable 'section' is used before it has been assigned a value. A null reference exception could result at runtime" in line 18.
2) Regardless of the changes I've made, I always end up getting "0" as my end result. I'm actually supposed to use the toString currency format function when getting my end result, but that was mixing me up so I figured I'd at least make sure the output is correct before I fix that part. I thought I was on the cusp of having this working but I think I'm confusing myself more and more the more I mess with it.
I'm currently designing an assembly that will be used by third parties. One of the classes has a long process of TCP connections and it informs about its process using events. For example
''# Do stuff that takes some time RaiseEvent CompletedFirstPartEvent() ''# Do stuff that takes some time
[Code].....
What I've seen if that if the handler of one of those events takes too long (or even worse, it blocks) I can have timeouts and it's hard for the developer to see that one class is not working fine because his handler is taking too long.
I was going to fire the events in a new Thread to avoid this issue but this looks strange to me because I've never seen something like that, what I've seen until now is the developer spawning a new Thread if his handler was going to be timeconsuming. So the question is:
What would you do? Create a new thread or force the user to create his own thread? (Or is -there a better approach that I don't know?)
I'm trying to use a TreeView in my current project and I'm not quite sure if it will work.I need my tree view to load the TreeView with the contents of the C: drive. Along with this, I need the nodes to be "checkable" so that I can tell my program to do certain things with items checked. Can this be done? If not with TreeView, is there somethings that is free that is an add-in that I can use?
I want the location of the current execution project i.e in VB.NET/C# or the current class file's path? Ok,let me elaborate i got 2 projects in one solution file,lets say A,B are projects, my startup project is B ,and im accessing a class file in A ,now i need to know virtual path of B. because i need it for accessing the resource file coz error pops up when using ExpressionBuilderContext
Is it possible to access the My.Settings of an other DLL referenced in the current Project? I have a Database project in which Settings the ConnectionString is stored. I need access to this Setting in an other Project(for Log-File).
I am trying to open a project in Visual Studio. I have VB.NET and C# installed. When I open the solution, it says
"The project file D:MyProjectsComboSample.csproj can not be be opened." "The project type is not supported by current installation"
What do I need to install? C# is already there.
ComboSample.csproj
Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComboBoxSample1", "ComboBoxSample1ComboBoxSample1.csproj", "{6A1F1EE5-4AED-40E0-9517-3EAC47442628}" EndProject
exit VB2008 without saving the current project?Or to revert to the previous saved version?After trying a few changes in my program I decided that is was not the way to go. So I wanted to discard my changes and start again with the program the way it was.
I'm making a application but I want it to be as small as possible also if you use the FormWhatever.Show function, if you close the parent window, everything closes. Is there a way to make a button open up an application that is NOT in the current project?
I'm having the reverse problem as this thread.We save off data in several formats, one of which is .XLS, however, some users may not have MS Office installed already, so I want to allow them to use the OS's "open with" dialog to associate with notepad or something so they can open the file.[code]...
I have a messagebox with a "yes" and "no" buttons. I am asking the user upon "exit" (ing) the app, if they haved saved their work. The default button is defaultbutton2 "no" and it saves the file. If user selects "yes" they have saved their work, then I need the app to close.Here's the code:
'show messagebox to save work....default button2 = 'no' then saves file....default button1 'yes' is spose to close app MessageBox.Show(
"Have you saved your work?",
"Garman Music Pro", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, 0, HelpButton)
If MessageBoxDefaultButton.Button2 = MessageBoxDefaultButton.Button2
I'm using vb2008 with DB MSA2007 (save it to MSA2003) on Seven(7)System After I create my project I build it(make exe). then I took the file of project (application) and the DB from Debug Folder.
I tried to run this application with DB on another computer it's system is seven and MSA2007 and work very well. then I run it on pc it's system XP and MSA2003. it showed this error
Application Error THE APPLICATION FAILED TO INTIALIZE PROPERLY (0XC000135). Click on OK to terminate the application
However, I am wondering if there are any workarounds or plans for incorporating this feature into VB.NET in the future?What I'd like to do:
Public Delegate Function Deserializer(Of T)(ByRef Buffer() As Byte, optional ByRef BufferPosition As Integer = 0) As T 'Implementation of a func that matches the delegate' Class A Public Function Deserialize(Byref Buffer() as Byte, optional Byref BufferPosition as integer = 0) ....
In the absence of specifying "optional" inside the actual delegate itself, it'd at least be nice to be able to do it in the function implementation only:
Public Delegate Function Deserializer(Of T)(ByRef Buffer() As Byte, ByRef BufferPosition As Integer) As T 'Implementation of a func that matches the delegate' Class A Public Function Deserialize(Byref Buffer() as Byte, optional Byref BufferPosition as integer = 0) ....
At least this second way, the functions for the delegate will always have a value mapped to each parameter, although some may come from the function side and not the calling side.
I am currently building a vb windows form application (.net 3.5 framework). For the next part of the application I want to be able to use an existing excel process which will have been checked out from sharepoint and manipulate the worksheet with my app.
For sometime now, we have developed an applicatio in Visula Basic (Express Edition). We would like to utilize the 64-bit processing power available in Windows 7 (our application runs currently in a Windows XP environment). So we are contemplating to migrate our VB application from a Windows XP-based environment to a 64-bit hardware platform running on Windows 7.
What is the best way to log into a website from a program. I can login using a web address. But I can't figure out how to utilize the web address and get it to log me in. I'm not too sure how to go about getting a login to work really. What is the best way to go about this? It is just a PHP-based website.
let's say I create a basic windows form with 100 textboxes, and create a variable that starts at 0, and counts up to 100. How could I pseudo-effortlessly have, for example, textbox7, when the variable is at 7, display a piece of text, instead of writing 100 lines of code such as
if vara = 7 then textbox7.text = "hello"
is there a way to utilize something in the nature of LINQ, where you could somehow say,
if vara = 7 then textbox & varA & .text = "hello"
this is just an example, I know it will not work, after paying a small bit of attention to the likeliness and possibility.....
Better Explaination of question: Is it possible to work on the same vb project at the same time?
I searched over google for help and I found a forum but it looked very complicated and I diden't feel like screw stuff p so can someone please give me a link or tell me how?
If i use custom images in my programs from my pc. After i publish this and give it to my friends they get errors due to them not having the images. How do i go about adding the images to the application or just generally how you resolve this?
I use a Vb 2008. I make connection with DB Ms Access2007. it show me this error couldn't find....... DBthen I change the DB Ms Access2007 to MS Access2003, and it works very well
I would like to utilize classes that inherit the System.Data name space.Specifically, I would like to have classes CarColumn, CarTable, and CarSet derived from DataColumn, DataTable, and Dataset respectively.I would like to be able to add additional properities to each class. As an example this is how I would like to reference items within the classes:
I followed the Quartz manual to the dot and still I'm not sure why it isn't picking up the GetDeal.vb (Quartz job) in Global.asax. It never went into the _scheduler.JobGroupNames and _scheduler.TriggerGroupNames loop as follows:
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim factory As ISchedulerFactory = New StdSchedulerFactory() _scheduler = factory.GetScheduler() _scheduler.Start()
[CODE]...
I've attached a link to download my Project here. how to make it work?- [URL]
i would like some help with how to start with my FINAL YEAR project work dubbed "SCHOOL TRACKING SYSTEM" . I am so much lost on how it shoud be like and what to actually do.