Solved

pthread threads under Windows respond very slow

Posted on 2006-07-18
4
395 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

691 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