LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-10-2007, 10:40 AM   #1
balaji_singh
LQ Newbie
 
Registered: Dec 2007
Posts: 2

Rep: Reputation: 0
Question thread scheduler disable & enable


Hi,

i'am runing 30 threads in a single process & i want the feature to disable & enable the thread scheduler in few threads, i would like to know what are the API's that can be called directly from the APPlication thread to stop the scheduler & start the scheduler.

I tried with ptherad_spin_lock() & pthread_spin_unlock() at the application level....able to compile the code,since the architecture is not an SMP architecture the exection has went to an while(1) mode.

I tried with preempt_enable() & preempt_disable() at the application level....failed to compile the code.

my code:
while(1)
{
preempt_disable();

/* HB LED - 600ms ON state */
ioctl(miscgl, 1, NULL);
usleep(1000 * 600);

/* HB LED - 600ms OFF state */
ioctl(miscgl, 2, NULL);
usleep(1000 * 600);

/* ESD-change - Check for PHY status and reset */
if(stop_trigger_flag == 0)
ioctl(miscgl, ESD_change, NULL);
preempt_enable();


}


compilation errors:
hblmain.c: In function `HBLENT':
hblmain.c:181: error: invalid type argument of `->'
hblmain.c:194: error: invalid type argument of `->'
hblmain.c:194: error: `TIF_NEED_RESCHED' undeclared (first use in this function)
hblmain.c:194: error: (Each undeclared identifier is reported only once
hblmain.c:194: error: for each function it appears in.)
make[2]: *** [hblmain.o] Error 1

Regards
Balaji singh
 
Old 12-11-2007, 09:02 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,504

Rep: Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388
Wow.

Maybe you should start by reconsidering exactly what it is you are trying to accomplish. Maybe you're taking the wrong approach. Thirty(?!?!?!) threads...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for a enable/disable mouse command to X samel_tvom Linux - Hardware 2 03-03-2005 12:00 PM
enable disable Tuttle General 0 01-08-2005 05:21 PM
FC3 yum.repos.d & how to enable/disable - HOW-TO cybrjackle Fedora 3 11-15-2004 02:05 AM
disable ethernet, enable wireless Ryan450 Linux - Wireless Networking 1 09-17-2004 05:53 PM
Enable/Disable GTk CheckButton Claus Programming 2 12-01-2003 05:44 AM


All times are GMT -5. The time now is 08:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration