Solved

pthread threads under Windows respond very slow

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

Suggested Solutions

Title # Comments Views Activity
XCode crashes while uploading to app store. 5 274
C Language combined operators 28 137
Socket Programming (Unix) 8 160
Windows Server 2008 R2: %HOMEDRIVE%%HOMEPATH% Incorrect 4 89
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

732 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