EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Linux and EPICS threads
From: "Jun-ichi Odagiri" <[email protected]>
To: "Mark Rivers" <[email protected]>, <[email protected]>
Date: Thu, 31 Jul 2003 05:44:54 +0900
I'm not 100% sure, but let me tell you my idea.

When you create a new epicsThread, actually, you create a new
posix thread through a call to a routine in the OSI-library.

The posix thread may be implemented on LinuxThread, which uses
clone system call. As a result, the new epicsThread become a kernel
level thread, which is to be scheduled by the Linux kernel with its own
task_structure.

We can specify which resources the parent and the child are to share,
by using an argument (bit flag) of the clone system call. You can
select the resources to be shared, say, memory space, file discripters,
signals, etc.

But you can NOT specify if the parent and the child share the status
flag in the control register of the CPU. It is a component of the low level
register context, but not a menber of the architecture independent
components of the task_struct.

The new epicsThread should be created with its own status flag.

J. Odagiri


-----Original Message-----
From: Mark Rivers [mailto:[email protected]]
Sent: Wednesday, July 30, 2003 2:07 PM
To: [email protected]
Subject: Linux and EPICS threads


I am writing device support on Linux for a parallel port device.  To talk to
the parallel port I use iopl(3) to set the I/O privilege level of the task,
and inb() and outb() to write to the I/O ports.  This works fine before
iocInit.  After iocInit the code is running in a new epicsThread, and I find
that it has "forgotten" the privilege level, and that I need to call iopl(3)
again.  This is very inconvenient, because the new thread should not even
need to know what kind of device it is talking to.

Is this the correct behavior, and is there a way to change it?  I thought
that the the ioc was running as a single task in which all threads should
have the same privileges.  Is there a way to make the new threads inherit
the privileges from the parent?

Thanks,
Mark Rivers


References:
Linux and EPICS threads Mark Rivers

Navigate by Date:
Prev: RE: Linux and EPICS threads Mark Rivers
Next: RE: Problem with static build on Linux Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Linux and EPICS threads Andrew Johnson
Next: RE: Linux and EPICS threads Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024