Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Temporarily disabling task switching.

I need to measure the response time of a slave controller. The master (the computer) sends a command to the slave, the slave responds with two bytes. Here a code extract ..

.
.
bw=write(serialport, &command, 1); // Write command - simply just the slave address
if (bw!=1)
err_sys("Could not write to serial port ");
ticks1=times(&buf); // Get time
br1=read(serialport, &responce[0], 1); // Read slave response
ticks2=times(&buf); // Get time
.
.
.

I then calculate the time delay from tick1s and ticks2.
This works, however if other processes are fired up (an application is started for e.g.) this process is being interrupted more often and the slave response time delay increases.
Is there a way to temporarily disable other tasks from interrupting this process over this critical section of code?

Jeff.

MacBook, Mac OS X (10.5.8)

Posted on Aug 5, 2010 12:14 AM

Reply
Question marked as Best reply

Posted on Aug 5, 2010 6:03 AM

I think that is why such things are typically done with a kernel extension.
3 replies

Temporarily disabling task switching.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.