sounds good, but tough :rolleyes:
any easier way at the cost of efficiency?
one more question..
can I manipulate the paging system for my program? i.e I force some page to load/unload to memory...
Type: Posts; User: gibsosmat
sounds good, but tough :rolleyes:
any easier way at the cost of efficiency?
one more question..
can I manipulate the paging system for my program? i.e I force some page to load/unload to memory...
sorry for late reply, I had exams :(
well.. I think I should have been more clear..
ok.. I will explain my prob..
I am trying to make a program that semi automatically extracts roads, rivers,...
hmm..
may be it can be.. but this is just an assignment.. so I didnt dig in too much :D
Also I didnt use those System V semaphores for this.. i.e <sys/sem.h>
though they are flexible & powerful...
this code is same for all the process accessing the memory..
so the one who calls resource first will do it..
though documentation didnt specify if the sem_wait requests are processed in FIFO...
I want to know how to handle heavy input files that are around 500MB
with normal school way of reading everything into memory wont be good..
and it fails sometimes if the library cant go to that...
you are right.. :D
they were typos
This is called third readers-writers problem.. and its standard..
I didnt know that..
I got it done :)
here it is..
/* to keep track of process entering and leaving shared mem */
int...
wont this work for .so?
you cannot do that as it is..
coz C dosent allow you to give variable length of arrays.. it is something like C compiler allocates memory for your array during compilation
but there is a way to...
no prob.. may be that -lrt is not so famous..
I found on some mailing lists that -lrt got some problem with pthread..
(it was 3-4 years old message)
and was advised to used pthread for...
lol..
thats what I was doing :D
but I tried something like
-lpsem
-lposix
-lps
-lsem
-lsema
-lsemaphores
-lmut
thanks..
I thought it was only a posix thread lib.. :D
still which is the actual lib for posix IPC functions?
do you have any idea about my original prob?
as the title states..
what is the best way to know which function call belongs to which library?
I was coding in C and using GCC 4.x..
I know how to use System V IPC semaphores..
but I wanted...
hmm.. I had a similar prob to do..
if you are not using some other program/daemon/installers..
you can do it simply by a batchfile..
generate a bathcfile before quit.. and generate it on the fly...
either you forgot programming in C. or you dont know how to do it..
there are lot of problems in your code..
avoid inliners..
what you want to do was *heruptr+=5;..
you better put it *heruptr...
float fonction(float mat[][24])
{ int *heureptr;// your mat[][] is type float
for(i = 0; i < 12; i++)
{
*heureptr = mat[i];
...
I didnt understand..
hmm..
sometimes if you want to change the string you dont have to go to every point and change it..
if you have something like this
main()
{
char str[]="I am string1";
...
yeah.. you are right..
but the definition if the variable is wrong..
what you defined is that heureptr is of type int, and NOT int pointer
if you want to use it as a pointer you should define...
argv[count][0] is a character NOT a string..
you are trying to compare char to a string..
...
float fonction(float mat[][24])
{ int heure; /* I guess you wanted it to be int *heure;
for(i = 0; i < 12; i++)
{
*heureptr = mat[i];
...
thanks for your help..
I am trying to solve that starvation..
But most of the articles on net are using locks for read/write access..
I will figure it out..
any help from you is appreciated.....
#include <unistd.h>
#include <signal.h>
...
pid=fork();
if(pid==0)
{
if(execvp(com[0],com)==-1)
{
printf("execvp failed\n");
pause();
I think in C99 one can do this.. it works for me.. long ago I tdidnt..
I am using GCC 4.1 on Linux
its the else case not inside the if( )..
so that the child will wait for execvp( )
I think his problem being invalid pid provided to waitpid( )..
if we put wait( ); there it will wait till the...