This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: memory saving scheme for stacks


Given that the threads could be interrupted and preempted at any point and any
stack depth.
Fleshing out the idea a bit more:

Add a new kernel API where SST threads can indicate when they are
preemptable by other SST threads, i.e. when the thread usage is at its
lowest.
how do you propose to decide when the thread usage is at it's lowest? - is only way for this is - the responsibility comes on the programmer to code accordingly.

but there are situations when SST can be moved out by another thread (SSI/normal) as a result of it's time slice getting over. The stack usage may not be at it's minimum then.


for (;;) { // sleep here...

	cyg_thread_ss_suspend(); // do not let other SST threads run
	// do processing where stack usage is at its highest
	cyg_thread_ss_resume(); // let other SST threads run
}

-- regards sandeep -------------------------------------------------------------------------- "Every morning, I get up and look through the 'Forbes' list of the richest people in America. If I'm not there, I go to work" -- Robert Orben --------------------------------------------------------------------------


-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]