From: Luca A. <luc...@em...> - 2003-04-22 13:25:55
|
Jury, I sent an answer to you, but it bounced... Others (mainly Paolo), are you ok with the interface change proposed by Jury (adding a killer_param parameter to ll_context_create)? Luca -----Forwarded Message----- > From: Luca Abeni <luc...@em...> > To: Jury Benesz <yb...@tu...> > Subject: Re: OSLib, my os (SD-32 stormdos) > Date: 22 Apr 2003 16:03:19 +0100 > > Hi Jury!!! > > > I'm glad to infrom you that my own OS based on OSLib and partially > > freedos-32 is going to work! ;) > Cool!!! > > > I use a table of 'process entries', i.e. an array of structures > > describing a process: base, size, stack, stack_size, CONTEXT, flags. The > > flags inform whether a process is active, whether this entry is > > occupied/valid and a kind of process: child/thread or > > parent/program. So inside my system I use PROCESS_IDs which > > reference into that table of processes, i.e. not CONTEXTs. > Ok... This is a fairly standard solution: shark is also using something > similar. > > > As I use > > context_create/delete I use a default killer procedure which uses my > > own delete_process function but (!) the killer function gots no > > parameters (opposite to the thread body) so I have to find my > > PROCESS_ID by looking through the table of processes for > > entry[i].ctx==ll_context_from(). > Generally, a kernel has some variable storing the ID (in your case, an > integer indicating the PROCESS_ID) of the executing thread/task. This is > used by the scheduler (or by some other kernel subsystem) to perform > accounting, and is set by the scheduler when a context switch happens. > The "standard solution" to your problem would be to use this variable > (since the killer executes in the context of the thread that is > terminating...). > > > The only thing I ask to add into OSLib > > is a function ll_context_create() with a support for killer routine > > with a parameter, so I can pass a process's ID as a parameter and > > simply do: > Ok, if you really want it (i.e., if you cannnot or don't want to use the > "current task" variable), I have no objection to such modification... > The only problem is that I have not much time to implement it right now > (I am busy with my job, and I'll be out of town for about 3 or 4 days in > the next week). Hence, I could do it only after the 1st of may. In the > meanwhile, if you want to provide a patch (it should not be that > difficult: I think that pushing the parameter on the task stack when > build it in ll_context_create would be enough), you are welcome. > > Luca > -- > _____________________________________________________________________________ > Copy this in your signature, if you think it is important: > N O W A R ! ! ! -- _____________________________________________________________________________ Copy this in your signature, if you think it is important: N O W A R ! ! ! -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi un notebook potente, funzionale ideale per il lavoro? Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=763&d=22-4 |