Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Doubt in using NULL pointer Pin
Cool_Dev9-Mar-10 18:36
Cool_Dev9-Mar-10 18:36 
GeneralRe: Doubt in using NULL pointer Pin
KASR19-Mar-10 18:44
KASR19-Mar-10 18:44 
GeneralRe: Doubt in using NULL pointer Pin
Cool_Dev9-Mar-10 19:02
Cool_Dev9-Mar-10 19:02 
GeneralRe: Doubt in using NULL pointer Pin
Tim Craig9-Mar-10 21:54
Tim Craig9-Mar-10 21:54 
GeneralRe: Doubt in using NULL pointer Pin
KingsGambit9-Mar-10 19:33
KingsGambit9-Mar-10 19:33 
GeneralRe: Doubt in using NULL pointer Pin
CPallini9-Mar-10 20:45
mveCPallini9-Mar-10 20:45 
Questionhow to don't allow interruptions in a piece of code in VC++ Pin
timbk9-Mar-10 15:38
timbk9-Mar-10 15:38 
AnswerRe: how to don't allow interruptions in a piece of code in VC++ Pin
Luc Pattyn9-Mar-10 16:11
sitebuilderLuc Pattyn9-Mar-10 16:11 
Hi,

AFAIK you can make a piece of code almost atomic by temporarily raising the thread priority to REALTIME, then restore it (don't run REALTIME for more than a few dozen microseconds!). That would be fine most of the time, however a high-priority interrupt, a DMA operation, or another REALTIME operation, may steal the CPU from you for a short period.
Warning: I doubt changing the priority twice will reliably be handled in 30 microseconds, so it may not be good enough.

If that is insufficient, the official approach is to write a driver.

Is your PC generating the 30 usec tacting, or is your peripheral? how do you that?

If it isn't a potential data overrun problem you are facing, the system-level approach would be to use two-way handshake, i.e. the PC reporting back it has read the data, so the peripheral is allowed to present the next data. Doing so, the communication could slow down temporarily while maintaining good overall bandwidth.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.

GeneralRe: how to don't allow interruptions in a piece of code in VC++ Pin
timbk9-Mar-10 16:48
timbk9-Mar-10 16:48 
GeneralRe: how to don't allow interruptions in a piece of code in VC++ Pin
Luc Pattyn9-Mar-10 16:52
sitebuilderLuc Pattyn9-Mar-10 16:52 
GeneralRe: how to don't allow interruptions in a piece of code in VC++ Pin
timbk9-Mar-10 16:57
timbk9-Mar-10 16:57 
GeneralRe: how to don't allow interruptions in a piece of code in VC++ Pin
Luc Pattyn9-Mar-10 16:59
sitebuilderLuc Pattyn9-Mar-10 16:59 
GeneralRe: how to don't allow interruptions in a piece of code in VC++ Pin
timbk9-Mar-10 17:13
timbk9-Mar-10 17:13 
GeneralRe: how to don't allow interruptions in a piece of code in VC++ Pin
Luc Pattyn9-Mar-10 17:18
sitebuilderLuc Pattyn9-Mar-10 17:18 
GeneralRe: how to don't allow interruptions in a piece of code in VC++ Pin
Luc Pattyn9-Mar-10 17:20
sitebuilderLuc Pattyn9-Mar-10 17:20 
AnswerRe: how to don't allow interruptions in a piece of code in VC++ Pin
Stuart Dootson9-Mar-10 21:03
professionalStuart Dootson9-Mar-10 21:03 
QuestionNumber of line in a Rect of Rich edit Pin
ForNow9-Mar-10 15:35
ForNow9-Mar-10 15:35 
AnswerRe: Number of line in a Rect of Rich edit Pin
Luc Pattyn9-Mar-10 17:04
sitebuilderLuc Pattyn9-Mar-10 17:04 
GeneralRe: Number of line in a Rect of Rich edit I put the pre tags in Pin
ForNow9-Mar-10 17:43
ForNow9-Mar-10 17:43 
QuestionModeless CPropertySheet destruction? Pin
Spawn@Melmac9-Mar-10 9:49
Spawn@Melmac9-Mar-10 9:49 
AnswerRe: Modeless CPropertySheet destruction? [modified] Pin
LunaticFringe9-Mar-10 12:43
LunaticFringe9-Mar-10 12:43 
AnswerRe: Modeless CPropertySheet destruction? Pin
Luc Pattyn9-Mar-10 13:54
sitebuilderLuc Pattyn9-Mar-10 13:54 
GeneralRe: Modeless CPropertySheet destruction? Pin
Spawn@Melmac10-Mar-10 6:17
Spawn@Melmac10-Mar-10 6:17 
QuestionStatic Library and Global Variables Pin
Ofer Gross9-Mar-10 8:46
Ofer Gross9-Mar-10 8:46 
AnswerRe: Static Library and Global Variables Pin
Avi Berger9-Mar-10 9:15
Avi Berger9-Mar-10 9:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.