[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Thread crashes

Posted on 2001-08-10
10
Medium Priority
?
288 Views
Last Modified: 2010-04-06
Hi all

I have an application that communicates with a usb device.
The application has a send thread and a receive thread that work together.
The problem is that the receive thread crashes in the stress.
This happened to me in the past when I had an application whet worked with a high baud rate communication device (PCMCIA).
The receive thread works in a high priorety.
Any help will be appreciated.
0
Comment
Question by:Tal_avidor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6372241
Off topic: Do you have my HID component? If not contact me.
robert_marquardt@gmx.de
0
 
LVL 20

Expert Comment

by:Madshi
ID: 6372273
What kind of crash is it? Could you show us the code where it crashes and the exact exception message?

Regards, Madshi.
0
 
LVL 14

Expert Comment

by:AvonWyss
ID: 6372280
Madshi is right, the information provided is unsufficient to provide a reliable suggestion or even answer.

Usually, when multithreading problems occur, it's because of unsynchronized access to any kind of ressource which is not thread-safe itself.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Expert Comment

by:FrodoBeggins
ID: 6372337
What dou you use for connecting the Net? Some component, I guess? Which one?

Do your "sender" and "receiver" share the same information? How they interact with the visual side if the program (if any)? Delphi VCL is not thread-safe, you know...

Rgds,
Yavor
0
 
LVL 2

Expert Comment

by:FrodoBeggins
ID: 6372343
One more important question. Do you use synchronious (blocking) connection or asynchronious (non-blocking)?

Rgds,
Frodo
0
 
LVL 2

Expert Comment

by:FrodoBeggins
ID: 6372375
Hehe... Yavor, Frodo... always me :)
0
 

Expert Comment

by:comptebidon81
ID: 6372601
If I understand right, your receive thread is sometime too slow and cannot receive all of the information? Do you have some kind of long processing with the datas that would slow the reception?

If so, (and if not already done) you could try to Post the information as soon as received and process it only when you have enough time.  (or use the same thread executed numerous times for each "bag" of info)

I guess the overall speed of the process will decrease a little, but your thread will not be overflowed anymore.

GunDamn
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6372923
Data not read from USB fast enough is simply overwritten by the new data. There is a small queue in the driver.
The other problem with USB is that you can get Windows lockups as long as 90 msecs where the USB is not served.
0
 
LVL 1

Author Comment

by:Tal_avidor
ID: 6373985
1) robert_marquardt can u tell me more abute this  "windows lockups".

2) comptebidon81 " you could try to Post the information as soon as received and process
it only when you have enough time".
this is what i did and it now the Thread is stabel.

I don?t use any component to work with usb.
I coded the devices firmware and driver my self.
And the application in Delphi is suppose to test the device. I will probably give comptebidon81 the points but I will not close this q I still need to test the thread a more.


0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 900 total points
ID: 6375069
Windows simply gives higher priority to other parts of the OS so the USB is sometimes simply not served. That is tha bad architecture of Windows.
You should definitely go to
http://www.usb.org/forums/developers/webboard.html
There all USB developers meet to discuss their problems.

Please give me your email address and i will send me my HID component written in Delphi.
No problem with the point assignment. I do not hunt for points.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question