Argonne National Laboratory

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  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 
<== Date ==> <== Thread ==>

Subject: RE: Linux and EPICS threads
From: "Jun-ichi Odagiri" <jun-ichi.odagiri@kek.jp>
To: "Mark Rivers" <rivers@cars.uchicago.edu>, <tech-talk@aps.anl.gov>
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:rivers@cars.uchicago.edu]
Sent: Wednesday, July 30, 2003 2:07 PM
To: tech-talk@aps.anl.gov
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 
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 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·