Any particular reason? It's the same thing in the end, just a lot more convoluted.
I read on stackoverflow.com that it is more portable. I have no particular must, just curiosity, I am also reading about POSIX ones.
Quote:
Originally Posted by Corona688
Do the games inherit shared memory for the parent or not? When you fork(), shared memory is inherited, so if the parent had it the children will start off with it and not need to fool with shmat().
Oh, I haven't noticed that fact. Good to know.
Quote:
Originally Posted by Corona688
You have to store the contents in the shared memory, never heap pointers.
Ok, I will remember that.
Quote:
Originally Posted by Corona688
Even pointers to the shared memory might not work unless every process maps the memory in the exact same place.
Do you mean that below code is wrong?
Quote:
Originally Posted by Corona688
Just make a big enough memory segment in the first place and the OS will dynamically allocate more pages as you use them.
I think that is my problem. What does it mean big enough? Server doesn't know how much clients would have. The main point is how to organize this shared memory to grow as new games are started.
Quote:
Originally Posted by Corona688
That could be a ridiculous number of semaphores for a lot of clients, though. You could have an integer stored in shared memory of whose turn it is, and when a client is created they poll it until they're told it's their turn, then they sem_wait()/sem_post()/sem_wait()/sem_post()... I think the order would remain stable after that.
Good idea, thanks
Quote:
Originally Posted by Corona688
As for your game structure -- instead of a structure full of big arrays, how about a big array of structures?
I am not sure if I understand well. Could you propose any sketch?
My System is FC3, The following Players don't run well:
1).Helix Player couldn't play MP3 and *.wma files,
2).Totem is the same,
3)XMMS couldn't play .wma files.
I am a newer of Linux,but I like Linux,just as you.
Could you help me?
Thank you! (1 Reply)
When I compile this C programme I get different outputs each time I run it
Please explain to me whats happening in the code if you can give me a detailed explanation. Because I am stuck with this.
#include <stdio.h>
main(){
int i = 0;
printf("I am the... (1 Reply)
When I compile this C programme I get different outputs each time I run it
Please explain to me whats happening in the code if you can give me a detailed explanation with the schedular functionality it will help a lot. Because I am stuck with this.
#include <stdio.h>
main(){... (3 Replies)
Hello All,
I am using Mozilla 1.7.8 on hp-ux 11.00, and install flash player 6 for it. it is giving following errors and get crashed. when i want to open a site need flash plugin.
Gtk-WARNING **: invalid cast from `GtkSuperWin' to `GtkWidget'
Gtk-WARNING **: invalid cast from `GtkSuperWin'... (1 Reply)
Is it safe to call fork+exec in a multithreaded application.
Because In my multithreaded application, I need to execute another program in each thread.
I am using solaris 10.
Any suggestions pls. (2 Replies)
I have an input file with contents like:
5785690|68690|898809
7960789|89709|789789
7669900|87865|659708
7869098|65769|347658
so on..
I need to pass this file to 10 parallely running processes (forking)so that each line is processed by a process and no line is processed twice and write the... (1 Reply)
Hi,
I am unable to install VLC or any other media players in my SL 6.3 distro. I am using yum utility to install the packages, but i am getting the below error messages,
--> Processing Dependency: libpng15.so.15()(64bit) for package: vlc-core-2.0.3-1.fc18.x86_64
--> Processing... (1 Reply)