Solved

pthread threads under Windows respond very slow

Posted on 2006-07-18
4
386 Views
Last Modified: 2008-02-01
An IO interrupt service function is bound to a thread created with phtread_create
(Win32). When an interrupt condition arises (IO set/reset), it takes considerable amounts of
times until the service function starts processing.
Is there a way to raise the priority of the thread ? I tried with scheduling attributes,
and detaching - with no effect.
0
Comment
Question by:Shony
4 Comments
 
LVL 12

Accepted Solution

by:
rajeev_devin earned 250 total points
ID: 17131026
Did you use this function pthread_setschedparam(...) ?

Check this link for details
http://www.cs.cf.ac.uk/Dave/C/node29.html#SECTION0029414000000000000000
0
 
LVL 8

Assisted Solution

by:manish_regmi
manish_regmi earned 250 total points
ID: 17131379

One way is to set the priority of the thread to maximim. as rajeev said use
int pthread_setschedparam(pthread_t thread, int policy,
    const struct sched_param *param);

struct sched_param param;

param.sched_priority  = sched_get_priority_max(SCHED_OTHER); // or whatever your policy is

But this will not gurantee the realtime response in your interrupt service. Due to the non realtime nature of windows, your service routine may run a little later (may be few milliseconds).

regards
Manish Regmi

0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

821 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