How to write a kernel patch to expose a kernel-level function?

I want to be able to call smp_processor_id() from user-space.  Of
course the patch would be used by only me.  (I am not asking someone to
write such to submit as an official patch.)

0
hzmonte (100)
1/30/2006 6:11:36 PM
comp.os.linux.misc 33611 articles. 22 followers. amosa69 (125) is leader. Post Follow

15 Replies
205 Views

Similar Articles

[PageSpeed] 47
hzmonte@hotmail.com writes:

> I want to be able to call smp_processor_id() from user-space.  Of
> course the patch would be used by only me.  (I am not asking someone to
> write such to submit as an official patch.)

Does this help:

http://altlinux.org/index.php?module=sisyphus&package=cpuid
0
daneNO2 (702)
1/30/2006 8:05:50 PM
hzmonte@hotmail.com wrote:
> I want to be able to call smp_processor_id() from user-space.  Of
> course the patch would be used by only me.  (I am not asking someone to
> write such to submit as an official patch.)


In principle, there are two ways of doing it:

  - write a new system call
  - create an entry in the /proc pseudo-filesystem

In both cases you need a piece of kernel code,
a patch or a kernel module.

Please be warned that the result processor may be
changed when you return from the system call reading
the information.

-- 

Tauno Voipio
tauno voipio (at) iki fi

0
1/30/2006 8:08:20 PM
>http://altlinux.org/index.php?module=sisyphus&package=cpuid
Thx but no, it is not what I want.  This package displays the CPU spec
like who the manufacturer is and what model it is, etc.  What I want,
and what smp_processor_id() returns, is which logical processor the
calling thread is running on.  Is CPU0, CPU1, or CPU2, for example?

>In both cases you need a piece of kernel code, a patch or a kernel module
So my question is How to write a kernel patch?  Is it as simple as
adding a statement in the source like "EXPORT TO USER-SPACE
smp_processor_id"?  Any pointer to how to do it?  Ay more concrete
guideline?

0
hzmonte (100)
1/31/2006 2:35:39 AM
hzmonte writes:
> What I want, and what smp_processor_id() returns, is which logical
> processor the calling thread is running on.  Is CPU0, CPU1, or CPU2, for
> example?

Why?  Of what possible use could that information be?  What problem are you
trying to solve?
-- 
John Hasler 
john@dhh.gt.org
Dancing Horse Hill
Elmwood, WI USA
0
john4584 (1601)
1/31/2006 2:52:33 AM
hzmonte@hotmail.com wrote:
>>http://altlinux.org/index.php?module=sisyphus&package=cpuid
> 
> Thx but no, it is not what I want.  This package displays the CPU spec
> like who the manufacturer is and what model it is, etc.  What I want,
> and what smp_processor_id() returns, is which logical processor the
> calling thread is running on.  Is CPU0, CPU1, or CPU2, for example?
> 
>>In both cases you need a piece of kernel code, a patch or a kernel module
> 
> So my question is How to write a kernel patch?  Is it as simple as
> adding a statement in the source like "EXPORT TO USER-SPACE
> smp_processor_id"?  Any pointer to how to do it?  Ay more concrete
> guideline?


The kernel runs in a private address space compared to
the user code. You cannot use the kernel internal
address for anything in user code, and it's not allowed
to even look at the contents of the address.

For details, get the books

   Understanding the Linux Kernel

and

   Linux Device Drivers

and read and understand them before attempting own
kernel coding.

Both books are published by O'Reilly.

IMHO, creating a /proc file is the easiest way of
reading the identifier.

A different story is that the result is probably
invalid at the time your user code gets it. There
is no guarantee that the process is running on
the reported processor anymore.

-- 

Tauno Voipio
tauno voipio (at) iki fi

0
1/31/2006 7:29:59 AM
>Why?  Of what possible use could that information be?  What problem are you
>trying to solve?

>A different story is that the result is probably invalid at the time your user code gets it. There
>is no guarantee that the process is running on the reported processor anymore.

I am trying to make sure sched_setaffinity() works.  That system call
allows you to restrict the execution of the calling thread on a (set
of) particular logical processor(s).  So, after I call
sched_setaffinity(), I want to call smp_processor_id() to see if the
thread is indeed executing on a processor selected.

0
hzmonte (100)
1/31/2006 8:03:38 AM
hzmonte@hotmail.com wrote:
>> Why?  Of what possible use could that information be?  What problem are you
>> trying to solve?
> 
>> A different story is that the result is probably invalid at the time your user code gets it. There
>> is no guarantee that the process is running on the reported processor anymore.
> 
> I am trying to make sure sched_setaffinity() works.  That system call
> allows you to restrict the execution of the calling thread on a (set
> of) particular logical processor(s).  So, after I call
> sched_setaffinity(), I want to call smp_processor_id() to see if the
> thread is indeed executing on a processor selected.
> 
Why not, instead, examine the kernel code related to this and see if it is
OK? Would that not be easier than tinkering with the kernel?

-- 
  .~.  Jean-David Beyer          Registered Linux User 85642.
  /V\  PGP-Key: 9A2FC99A         Registered Machine   241939.
 /( )\ Shrewsbury, New Jersey    http://counter.li.org
 ^^-^^ 05:15:00 up 10 days, 20:42, 5 users, load average: 4.08, 4.10, 4.09
0
jeandavid8 (984)
1/31/2006 10:19:25 AM
John Hasler <john@dhh.gt.org> wrote:
> hzmonte writes:
>> What I want, and what smp_processor_id() returns, is which logical
>> processor the calling thread is running on.  Is CPU0, CPU1, or CPU2, for
>> example?

> Why?  Of what possible use could that information be?  What problem are you
> trying to solve?

Dunno. Probably some mistaken idea. But anyway it would be simple to do
- some ioctl which returns what he wants. But doesn't he have the info
in proc anyway?

 % cat /proc/self/cpu
 cpu  0 1
 cpu0 0 1

Peter
0
ptb (2760)
1/31/2006 11:45:54 AM
Peter T. Breuer wrote:
> John Hasler <john@dhh.gt.org> wrote:
>> hzmonte writes:
>>> What I want, and what smp_processor_id() returns, is which logical
>>> processor the calling thread is running on.  Is CPU0, CPU1, or CPU2, for
>>> example?
> 
>> Why?  Of what possible use could that information be?  What problem are you
>> trying to solve?
> 
> Dunno. Probably some mistaken idea. But anyway it would be simple to do
> - some ioctl which returns what he wants. But doesn't he have the info
> in proc anyway?
> 
How would that do any good? When the process makes the kernel call on ioctl,
a process switch will occur and what would the ioctl return? The
processor-id that the process _used to_ run on, not the one it will run on
once the ioctl returns.

He is doomed. The only way I can think of that will work is to examine the
code of the kernel in the area where process switching occurs. I looked in
there a while ago, and it really tries to return a process to the same
processor it ran on before to try to maintain a high cache hit ratio, but
with the puny caches on my processors (1 Megabit L3 caches) compared to
process sizes (50Megabytes and up for some of the large ones), this may be
of only minor importance.

It depends on the working set size of all the processes currently running. I
have a dbms that runs many processes, and does a lot of IO. Runs pretty well
unless I let BOINC run 4 compute-limited processes at nice 19. Running BOINC
this way should take up all the otherwise unused CPU cycles and not
interfere with the higher priority processes, but it spoils the database
application(s). They try to do a disk write and suspend. Then a BOINC
process runs and dirtys up the caches, so when the IO for the dbms completes
and the dbms process resumes, the cache is completely dirty so it runs at
RAM speeds (533MHz) instead of processor speeds (3.06GHz).

-- 
  .~.  Jean-David Beyer          Registered Linux User 85642.
  /V\  PGP-Key: 9A2FC99A         Registered Machine   241939.
 /( )\ Shrewsbury, New Jersey    http://counter.li.org
 ^^-^^ 07:50:00 up 10 days, 23:17, 3 users, load average: 4.16, 4.11, 4.03
0
jeandavid8 (984)
1/31/2006 1:01:58 PM
Jean-David Beyer wrote:
> Peter T. Breuer wrote:
> > John Hasler <john@dhh.gt.org> wrote:
> >> hzmonte writes:
> >>> What I want, and what smp_processor_id() returns, is which logical
> >>> processor the calling thread is running on.  Is CPU0, CPU1, or CPU2, for
> >>> example?
> >
> >> Why?  Of what possible use could that information be?  What problem are you
> >> trying to solve?
> >
> > Dunno. Probably some mistaken idea. But anyway it would be simple to do
> > - some ioctl which returns what he wants. But doesn't he have the info
> > in proc anyway?
> >
> How would that do any good? When the process makes the kernel call on ioctl,
> a process switch will occur and what would the ioctl return? The
> processor-id that the process _used to_ run on, not the one it will run on
> once the ioctl returns.
>
> He is doomed. The only way I can think of that will work is to examine the
> code of the kernel in the area where process switching occurs. I looked in
> there a while ago, and it really tries to return a process to the same
> processor it ran on before to try to maintain a high cache hit ratio, but
> with the puny caches on my processors (1 Megabit L3 caches) compared to
> process sizes (50Megabytes and up for some of the large ones), this may be
> of only minor importance.
>
> It depends on the working set size of all the processes currently running. I
> have a dbms that runs many processes, and does a lot of IO. Runs pretty well
> unless I let BOINC run 4 compute-limited processes at nice 19. Running BOINC
> this way should take up all the otherwise unused CPU cycles and not
> interfere with the higher priority processes, but it spoils the database
> application(s). They try to do a disk write and suspend. Then a BOINC
> process runs and dirtys up the caches, so when the IO for the dbms completes
> and the dbms process resumes, the cache is completely dirty so it runs at
> RAM speeds (533MHz) instead of processor speeds (3.06GHz).

Isn't some of this info the OP desires (considering HT, and/or Dual
Core CPUs) highly dependent upon "which" brand (Intel or AMD64) the OP
is using ??

I'm not up on this at all - and I don't yet have a great grasp on
explaining the technology and functions , but doesn't AMD64 incorporate
_NUMA_, the HTT Bus, and the A64  Memory Controller is OnDie, ["MOESI
protocol" (Modified, Owned, Exclusive, Shared, Invalid)] since their ,
as oppposed to the Intel Architecture (Xeon, Pentium-D, and HT -- I'm
don't know about Itanium though).
<http://en.wikipedia.org/wiki/Non-Uniform_Memory_Access>
more info about the diffs;
<http://www.xbitlabs.com/articles/cpu/print/dual-core.html>

hmmm..wonder how MShafts PAE crap figures into all this too ?

0
1/31/2006 8:32:26 PM
> Why not, instead, examine the kernel code related to this and see if it is
OK? Would that not be easier than tinkering with the kernel?
Code examination is one way of making sure the code works as expected.
But I am not an expert at looking at kernel code. (It looks
intimidating.)  And who knows whether there are other code that may
affect the operation of the code I inspect. And if I can call that
smp_processor_id(), I can show it to others that the execution actually
occurs on a particular CPU as specified in sched_setaffinity() .  Also,
if I select a group of CPUs, rather than just one, in
sched_setaffinity(), code examination only tells me the execution will
happen on one of those CPUs, but smp_processor_id() tells me exactly
which one CPU is executing that thread.

0
hzmonte (100)
2/1/2006 2:29:35 AM
hzmonte@hotmail.com wrote:
>> Why not, instead, examine the kernel code related to this and see if it is
> OK? Would that not be easier than tinkering with the kernel?
> Code examination is one way of making sure the code works as expected.
> But I am not an expert at looking at kernel code. (It looks
> intimidating.)  And who knows whether there are other code that may
> affect the operation of the code I inspect. And if I can call that
> smp_processor_id(), I can show it to others that the execution actually
> occurs on a particular CPU as specified in sched_setaffinity() .  Also,
> if I select a group of CPUs, rather than just one, in
> sched_setaffinity(), code examination only tells me the execution will
> happen on one of those CPUs, but smp_processor_id() tells me exactly
> which one CPU is executing that thread.
> 
No. It tells you which one WAS executing that thread. But as the kernel
relinquishes the processor, it may give a different processor to you. Well,
if you locked yourself to one of them with some affinity trick, you would
get the same one back when it is available, but that is what you wanted to
find out.

In the short run, why not look at the output of top with the Y mode enabled.
Or look at the code for top (which I suppose is simpler than the kernel) and
see how they do it.

-- 
  .~.  Jean-David Beyer          Registered Linux User 85642.
  /V\  PGP-Key: 9A2FC99A         Registered Machine   241939.
 /( )\ Shrewsbury, New Jersey    http://counter.li.org
 ^^-^^ 23:05:00 up 11 days, 14:32, 5 users, load average: 4.37, 4.22, 4.12
0
jeandavid8 (984)
2/1/2006 4:10:02 AM
Jean-David Beyer <jeandavid8@verizon.net> wrote:
> Peter T. Breuer wrote:
>> John Hasler <john@dhh.gt.org> wrote:
>>> hzmonte writes:
>>>> What I want, and what smp_processor_id() returns, is which logical
>>>> processor the calling thread is running on.  Is CPU0, CPU1, or CPU2, for
>>>> example?
>> 
>>> Why?  Of what possible use could that information be?  What problem are you
>>> trying to solve?
>> 
>> Dunno. Probably some mistaken idea. But anyway it would be simple to do
>> - some ioctl which returns what he wants. But doesn't he have the info
>> in proc anyway?
>> 
> How would that do any good? When the process makes the kernel call on ioctl,
> a process switch will occur and what would the ioctl return? The

There is no special extra process switch on ioctl - he'll get whatever
cpu is running his ioctl.  Yes, it is another question if the kernel
decided to switch him to a different cpu on the i/o, but his chances of
that are low, or at least about as low as with anything he does if there
is any affinity at all. He can even change the schedule in his ioctl,
but that's harder.

> processor-id that the process _used to_ run on, not the one it will run on
> once the ioctl returns.

Indeed. But then the future is never predictable with certainty. The
real problem is that his experiment might provoke a change.

> He is doomed. The only way I can think of that will work is to examine the
> code of the kernel in the area where process switching occurs. I looked in
> there a while ago, and it really tries to return a process to the same
> processor it ran on before to try to maintain a high cache hit ratio, but
> with the puny caches on my processors (1 Megabit L3 caches) compared to
> process sizes (50Megabytes and up for some of the large ones), this may be
> of only minor importance.

One might be able to get general processor scheduler stats out on how
often a process is run by the same cpu.

> It depends on the working set size of all the processes currently running. I
> have a dbms that runs many processes, and does a lot of IO. Runs pretty well
> unless I let BOINC run 4 compute-limited processes at nice 19. Running BOINC
> this way should take up all the otherwise unused CPU cycles and not
> interfere with the higher priority processes, but it spoils the database
> application(s). They try to do a disk write and suspend. Then a BOINC
> process runs and dirtys up the caches, so when the IO for the dbms completes
> and the dbms process resumes, the cache is completely dirty so it runs at
> RAM speeds (533MHz) instead of processor speeds (3.06GHz).

Peter


0
ptb (2760)
2/1/2006 8:26:52 AM
Jean-David Beyer <jeandavid8@verizon.net> wrote:
> No. It tells you which one WAS executing that thread. But as the kernel
> relinquishes the processor, it may give a different processor to you. Well,
> if you locked yourself to one of them with some affinity trick, you would
> get the same one back when it is available, but that is what you wanted to
> find out.

http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html

  In kernel version 2.6 user mode processes can use the
  sched_setaffinity and sched_getaffinity system calls. There is a
  patch which backports them to 2.4.

  All recent Linux versions will try to keep processes as long time as
  possible on the same CPU. But processes will be moved if the CPUs are
  not equally loaded. True CPU affinity was introduced in 2.4.0, but is
  only available in kernel mode. It can be used from kernel modules,
  but was not used by the kernel itself. Starting in 2.4.7-pre5 it is
  used by ksoftirqd to start one instance for each CPU. In 2.5.8-pre3 a
  systemcall to set CPU affinity was introduced.

Peter
0
ptb (2760)
2/1/2006 11:02:54 AM
hzmonte@hotmail.com wrote:
> > Why not, instead, examine the kernel code related to this and see if it is
> OK? Would that not be easier than tinkering with the kernel?
> Code examination is one way of making sure the code works as expected.
> But I am not an expert at looking at kernel code. (It looks
> intimidating.)  And who knows whether there are other code that may
> affect the operation of the code I inspect. And if I can call that
> smp_processor_id(), I can show it to others that the execution actually
> occurs on a particular CPU as specified in sched_setaffinity() .  Also,
> if I select a group of CPUs, rather than just one, in
> sched_setaffinity(), code examination only tells me the execution will
> happen on one of those CPUs, but smp_processor_id() tells me exactly
> which one CPU is executing that thread.

FWIW -- RedHawk Linux
http://searchopensource.techtarget.com/specialEventsAnnouncement/0,289656,sid39_gci944356_egc946153,00.html

Nice info in PDFs, with kernel patch scripts;
http://www.informatik.uni-bremen.de/agbs/qualifikationsarbeiten/diplomarbeiten/2005_efkemann.pdf
http://www.ccur.com/isdmanuals/2RedHawk%20Linux/0898004-430_RedHawk_Linux_2.X_Users_Guide.pdf

0
2/1/2006 3:55:48 PM
Reply:
Similar Artilces:

FAQ 8.22 Why do setuid perl scripts complain about kernel problems? #14
This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.22: Why do setuid perl scripts complain about kernel problems? Some operating systems have bugs in the kernel that make setuid scripts inherently insecure. Perl gives you a number of options (described in perl...

Write long table into file problem
hi,all I have a problem in saving a table into a file, say i want to write a list of 7 numbers into file, I use the following code ------------------------------ strm = OpenWrite["~/output/test.dat"]; a = Random[ ]; temp = {{a, a, a, a, a, a, a}}; Write[strm, OutputForm[TableForm[Map[FortranForm, temp, {2}], TableSpacing -> {0, 3}]]]; Close[strm]; ------------------------------ and here is how test.dat looks like: ---------------------------------------- 0.7347723298312644 0.7347723298312644 0.7347723298312644 0.734772329831\ 2644 0.7347723298312644 ...

c pointer in s function
Hello, I have some problems to understand the syntax and the meaning of some pointers used in a C mex sfunction. For example taken the output method of the TimesTwo sfunction http://www.mathworks.com/support/tech-notes/1800/1819_files /timestwo.c I reported an extract hereafter : Int_T i; InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs(S,0); real_T *y = ssGetOutputPortRealSignal(S,0); int_T width = ssGetOutputPortWidth(S,0); for (i=0; i<width; i++) { /* * This example doe...

Changing Classification Level in ANN
Hi, ANN by default uses threshold of 0.5 for classifying records into 1/0 and then compares this with actual target value to create classification table in the output of running ANN. (I believe same threshold is used when ANN is computing the connection weights when the Model Selection Criterion is "Misclassification Error". I would like to change this threshold to a lower value, say .10 How do I change this in E Miner. I have a weighted data with wt=1 for target=1 and wt=5 for target=0, and have specified wt variable as "Frequency" role in my ANN model. Thank...

[9fans] compiling a pcauth kernel
--=-=-= Hi everybody, I am attempting to follow the directions in wiki at: http://plan9.bell-labs.com/wiki/plan9/Configuring_a_standalone_CPU_server/index.html I inserted the bootdir section into the kernel configuration file as directed; yet when I compile I get an error message (I have attached the entire compile output at the end of this message): 8c -FVw bootpcauth.c 8l -o bootpcauth.out bootpcauth.8 ../boot/libboot.a8 print.8 .../port/mkroot bootpcauth boot bootpcauth.c:8 name not declared: configfactotum bootpcauth.c:8 name not declared: connectfactotum bootpcauth.c:8 name not decl...

template function compareLess
Hi, I've written a custom Iterator and managed to get things working ok. I'm looking to see if I can reduce the amount of template instantiation in my code however (borland gives an out of memory when compiling the whole app). template <class T > class compareGreater // (T p1, T p2) { bool operator()( T& p1, T& p2) { // does comparison by calling operator< on types T } }; I have many types T in this codebase and I would like, if possible, to prevent a new compareGreater<T> being instantiated for all types. Instead I'd like all ...

Re: Writing to Excel
It's a topic of great interest and there are undoubtedly a number of SUGI papers fitting the description. Browse or search from http://www.lexjansen.com/sugi/ There are lots of SAS2XL alternatives, and it depends on the SAS version as well as on which SAS products are licensed. Since tools are created/refined over time, a non-recent paper may be incomplete vis a vis today's environment. So perhaps you want to provide specifics, including but not limited to: 1. Do you have a license for SAS/Access for PC File Formats? 2. Are you just concerned with exporting data, or do you also car...

To write or not to write
Hi, Looking at getting http://www.meshcomputers.com/updated/tablea_1.htm but I emailed Mesh to ask about the touch screen and writting this was the response: "Thank you for your email. Provided you do not lean on the screen whilst writing with the stylus there will be no problem." ok so if I were to write on the screen I have to keep my hand of it completly, has anyone experiece with this do I have to keep my hand of the screen and is it that difficult to write with your hand raised Cheers Olly ``the_knowledgeable_1'' asked: >Looking at getting http://www.meshcomputer...

IEEE802.16e
Dear All, I trying to run a system level simulation for IEEE802.16e, but the performance is extremely slow. Any idea how to speed up the simulation ? Is there any relevant paper that describe methodology used for system level simulation for 802.16e ? The procedure I use for simulation is 1. At mobile, calculate received power after path loss, shadowing and multipath fading for each subcarrier 2. At mobile, measure interference power from first tier and second tier base station, for each subcarrier, after path loss and shadowing. Multipath fading from first tier and second tier base station...

write through cache and hit ratio
hi, anybody can tell me what is the benefit from hit ratio in write through cache case? On Jan 22, 9:47=A0am, huda <halmam...@yahoo.com> wrote: > hi, > anybody can tell me what is the benefit from hit ratio in write > through cache case? Is this a write-allocate or write-no-allocate cache? Is the cache attempting to be choerent or not? If so what protocol? On 22 =ED=E4=C7=ED=D1, 22:39, MitchAlsup <MitchAl...@aol.com> wrote: > On Jan 22, 9:47=A0am, huda <halmam...@yahoo.com> wrote: > > > hi, > > anybody can tell me what is the benefit from hit ra...

Writing an image
Hi all, I was trying to hava a CGI script return an image, but it was coming back corrupted. So I tried this simple non-CGI test and still get errors: import sys image = open('pic.jpg','rb').read() sys.stdout.write(image) When I run this like "python pic.py > pic2.jpg" The resulting pic2.jpg is not identical to the original. I looked at it in a hex editor, and it seems to be identical with the original pic.jpg, except for several 0D (carraige return) characters inserted throughout the file. I tried this with Python 2.2.1 and 2.3.2. What's going on? Thanks...

IIF Function help please
I need to create an IIf function. I have a field called "BREED". There are only two types that can go in this field, either "Siamese" or "OSH". In the next field (Eye Colour) I want to enter the eye colour depending on the Breed automatically. If it is Siamese then the result I want under eye colour is "Blue" and if it is OSH then I want the eye colour to enter Green automatically. Is this possible? Is the IIF function the correct one to use, if so, what the heck is the code!!!!! thanks Julie [posted and mailed] "Julie Nico...

Make a small function thread safe
Hey guys, I have a C++ function that I'd like to replicate (as closely as possible) in Python. Here's an example: 107 void increment_counter( unsigned int& counter ) 108 { 109 boost::mutex::scoped_lock lock( counter_lock ); 110 ++counter; 111 } A thread locks the function on entrance and then releases it on exit. What is the equivalent way to do this in Python? Many thanks! Brad On Fri, 2011-12-16 at 05:21 -0800, Brad Tilley wrote: > 107 void increment_counter( unsigned int& counter ) > 108 { &g...

Very low writing speeds on RAID 0 with HPT374
X-post to de.comp.hardware.cpu+mainboard.amd, comp.windows.misc, comp.sys.ibm.pc.hardware.storage as I'm not sure what kind of problem I have. Hello, I am experiencing a very strange problem with extremely low writing speeds, and I'd be really glad if anyone had a solution for it: As I noticed a significant decrease in system performance, rendering video capture (which never was a problem before) virtually impossible, I did some benchmarks and found a ridiculous low writing speed. To exclude software problems, I did a clean new install; the following results were collected with only ...

Harddisks: Seek, Read, Write, Read, Write, Slow ?
Hi, Take these 3 concepts and then look at the implementation/performance: ( 3 Concepts for reading/writing with harddisks ) Concept 1: Seek, Read, Read, Read, Read, Read, Etc Results: FAST Concept 2: Seek, Write, Write, Write, Write, Write, Etc Results: FAST Concept 3: Seek, Read, Write, Read, Write, Read, Write, Results: SLOW ??? The pseudo code is like: Seek( 0 ); // offset 0 For I:=0 to FileBlocks-1 do // number of 4KB blocks in file. begin if Random(2) = 0 then Read( 4 KB ) Else Write( 4 KB ); end; The original con...

does Matlab come with routines for reading and writing wav files
I noticed that people can use matlab to read wav files, manipulate the sound, and (I presume) write wav files. I cannot determine if matlab, or the signal processing toolbox come with the routines for reading and writing wav files, or if I need to obtain those routines elsewhere. Please advise. Thanks, --Joe Joseph wrote: > I noticed that people can use matlab to read wav files, manipulate > the sound, and (I presume) write wav files. > > I cannot determine if matlab, or the signal processing toolbox come > with the routines for reading and writing wav files, or if I need t...

Does package level access apply to multiple source files?
Hi; I read that classes within the same package can access each others functions as if the were their own. This seems to be case when all of the classes are in the same source file. However, I tried experimenting with 2 classes, separate source files, same directory, same package. When I try to access a funciton, just by typing the function name from one class in another file the compiler tells me it can not find that function. I am misinterpreting package level access? Thanks in advance for any info Steve On May 26, 11:35 pm, Steve <tinker...@gmail.com> wrote: > Hi; > ...

function sequence error on aix5.2
hi all, i am a c++ developer(so chose to post it in c++ group) facing a problem with DB2-CLI on AIX5.2. we are using db2 v8 fixpak 10, gcc 3.3.2, on aix5.2 with extensive use of STL vectors. we are using ODBC 3.0 for our applications. the exception we are getting is "function sequence error cli0125E". we are using multithreaded applications which uses pthread library. with single thread the application works fine without any such exceptions. but when we execute with more than 1 thread , we are facing this exception "function sequence error". we set most of the parameters ...

Xailer
This is another fantastic feature of Xailer. It did not work for me, but I made a simple patch, now we can use as we await the official solution: patch (http://goo.gl/vxcet2) note: It is available the new version of Xailer (http://xailer.info/wordpress/en/?p=264). ...

gamma and log gamma function
Hi All, =20 I have an expression that I'm trying to calculate where part of it has this form : [gamma(a)/gamma(b)] -[gamma(d) - gamma(g)]. =20 I'm having difficulty because the arguments for the gamma function become too large. It was suggested that I use the log gamma function to resolve this. Basically I would take the exp(log(expression)) and I would be able to avoid the huge number by using the log gamma function. Unfortunately reworking the above expression involves a log of a sum in the numerator so I can't use the log gamma function for that part. =20 Does anyone know ...

to write or not to write a BLASTED device driver
I have read the Solaris DDI/DDK manual cover to cover more than once, and I am following the example source provided (pio.c to keep it simple) win sun_device_drivers.tar. I am at a point where my driver appears to be added but fails to attach. Now the part that has me irked is - I CANT see any error messages I have written out through "cmn_err()" man syslog man syslog.conf allowed me to reconfigure my /etc/syslog.conf as follows: *.alert;*.crit;*.emerg;*.err;*.warning * *.notice;*.debug * Technically all error messages /notices should appea...

Re: ANOVA procedure for 3 levels repeated measures
Sam Gu <sasprof@HOTMAIL.COM> wrote: > I am doing analysis on a experiment which has 14 subjects. Each subject has > 3 measures under 3 treatments. Now I am looking at 2 issues: > .How to test the power of the sample? > SAS analyst application can be used to test the power of one-way ANOVA, > but I am not sure how the repeated measures can be fit in. > 'Which procedure would be suitable for this experiment? > Considering the sample size and the uncertainty of normal distribution, > I am not sure if proc ANOVA and Mixed would be a good choice. In face, I...

Is the "posix kernel API" the same as the "linux system calls"?
I'm trying to understand some general things about the linux kernel compared to the posix kernel API and system calls. So here are my questions: Is the "posix kernel API" the same as the linux "system calls"? If not, what is the difference? >From what I understand, system calls are the only interface that user programs can use to interact with the kernel. Are system calls a form of kernel function? Can/do kernel functions call system calls? BR! "dspfun" <dspfun@hotmail.com> wrote in message news:1155135433.146861.158800@75g2000cwc.googlegroup...

docs patch
This is a multi-part message in MIME format. --------------030505080709060803010809 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit That attached patch updates the docs for COPY CSV to include the recently discussed limitation on importing data with embedded line-end characters. Maybe we also need a TODO to revisit this during the 8.1 cycle, but I don't believe we should do more than this for now. cheers andrew --------------030505080709060803010809 Content-Type: text/x-patch; name="copydoc.patch" Content-Tra...

Writing Textures
Hello Everyone, I want to copy the contents of the framebuffer into a texture and have it as an array of values and also save it as some sort of image file. I know that I have to use the glCopyTexImage2D function, but I don't understand how to specify the array in which the values will be stored and I don't know which function to use to write the values into an image file. When I use the GL_TEXTURE_2D as the target parameter for glCopyTexImage2D, where exactly are the texels stored? I use the glGenTextures and glBindTexture to generate a texture name and specify it as the default te...