* Changing thread_info->task, does it harm?
@ 2005-08-14 12:41 Samer Sarhan
2005-08-14 12:52 ` Arjan van de Ven
2005-08-14 12:56 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Samer Sarhan @ 2005-08-14 12:41 UTC (permalink / raw)
To: linux-kernel; +Cc: Ahmed Mohamed Tarek
Hi,
I had a design problem of a Linux module (Linux 2.6.11) that lead me to do this:
int work_fn(void* data);
task_t my_task;
task_t* kthread = kthread_create(work_fn, NULL, "Task 1");
// assume kthread create was successfully...
my_task = *kthread;
// change what current maceo points to...
kthread->thread_info->task = &my_task;
...
...
wake_up_process(&my_task);
...
..
well... is it dangerous to change what current macro points to through
changing thread_info->task?
Please help!
Thanks for help in advance!
--
===========
Samer Sarhan.
"To understand recursion, you need to understand recursion."
http://samersarhan.blogspot.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Changing thread_info->task, does it harm?
2005-08-14 12:41 Changing thread_info->task, does it harm? Samer Sarhan
@ 2005-08-14 12:52 ` Arjan van de Ven
2005-08-14 12:56 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Arjan van de Ven @ 2005-08-14 12:52 UTC (permalink / raw)
To: Samer Sarhan; +Cc: linux-kernel, Ahmed Mohamed Tarek
On Sun, 2005-08-14 at 15:41 +0300, Samer Sarhan wrote:
> Hi,
> I had a design problem of a Linux module (Linux 2.6.11) that lead me to do this:
>
> int work_fn(void* data);
> task_t my_task;
> task_t* kthread = kthread_create(work_fn, NULL, "Task 1");
> // assume kthread create was successfully...
> my_task = *kthread;
> // change what current maceo points to...
> kthread->thread_info->task = &my_task;
> ...
why ?
> well... is it dangerous to change what current macro points to through
> changing thread_info->task?
it most likely is.
1) Why do you think you need to do this ??
2) What are you trying to solve?
3) What is the URL to the sourcecode of your module ?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Changing thread_info->task, does it harm?
2005-08-14 12:41 Changing thread_info->task, does it harm? Samer Sarhan
2005-08-14 12:52 ` Arjan van de Ven
@ 2005-08-14 12:56 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2005-08-14 12:56 UTC (permalink / raw)
To: Samer Sarhan; +Cc: linux-kernel, Ahmed Mohamed Tarek
On Sun, Aug 14, 2005 at 03:41:49PM +0300, Samer Sarhan wrote:
> Hi,
> I had a design problem of a Linux module (Linux 2.6.11) that lead me to do this:
>
> int work_fn(void* data);
> task_t my_task;
> task_t* kthread = kthread_create(work_fn, NULL, "Task 1");
> // assume kthread create was successfully...
> my_task = *kthread;
> // change what current maceo points to...
> kthread->thread_info->task = &my_task;
> ...
> ...
> wake_up_process(&my_task);
> ...
> ..
>
> well... is it dangerous to change what current macro points to through
> changing thread_info->task?
Yes. It's totally broken.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-08-14 12:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-14 12:41 Changing thread_info->task, does it harm? Samer Sarhan
2005-08-14 12:52 ` Arjan van de Ven
2005-08-14 12:56 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®