Search:

Type: Posts; User: kbzium

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    894

    Best method of terminating a program

    Hello!

    I have a program which consists of N processess. One of them (the parent) has created sets of semaphores, shared memory and message queue. How to clean after this program nicely? I know i...
  2. Thank you for your reply! But how can i...

    Thank you for your reply!

    But how can i "spare" the first message that client sent me via telnet? If dedicated client would write some dummy hello "I'm a client not telnet" it must be processed by...
  3. How to determine if the client is connecting via telnet?

    Hi there,

    what's the best (simpliest) way to determine if a client is using telnet? I'm writing simple chat on linux and it must have different functionality for different type of clients. Telnet...
  4. Maybe it has something to do with message queue?...

    Maybe it has something to do with message queue? But... if one process read, this data is lost... so only one could read...
  5. It appears that the semantics that you've posted...

    It appears that the semantics that you've posted is the one that i'm looking for. But still, i can't think of any solution to this problem.
  6. They should block if there are no new messages....

    They should block if there are no new messages. If a new message appear, than first of the readers should come in and let the others in. But there's a problem. Noone can leave this part of code until...
  7. Oh I meant line 18... It holds all readers until...

    Oh I meant line 18... It holds all readers until a writer won't V(USED)... It is written so. There is a vital question:

    if N processess wait at semaphore A which has been latched by first of them,...
  8. I understand that P(buf_free) at the line 9 (in...

    I understand that P(buf_free) at the line 9 (in post 10) latches all the readers so they must wait until a writer writes something. Then they all should get into next lines, yeah?

    But it doesn't...
  9. But wouldn't this make processess read messages...

    But wouldn't this make processess read messages not simultanously but sequentionally which is not what i intended?


    Thank you!
  10. Shared memory & semaphores - communication between processess

    Hello,

    i'am thinking how to deal with such problem:

    There're N child processess and one shared memory to let them communicate between each other. Every one of them should be able to write a...
  11. Replies
    9
    Views
    12,021

    Quzah i thought about it at first, setting a flag...

    Quzah i thought about it at first, setting a flag is easy but what about unsetting it? Who would do that?

    I did it by "brute force": i added checksum to every last message so all the clients...
  12. Replies
    9
    Views
    12,021

    How can i make one child-server process write...

    How can i make one child-server process write message to all the other sibling processes in a real-time? That's why i thought about pipes...
  13. Replies
    9
    Views
    12,021

    I did it with 2-dim array. I think it's okay...

    I did it with 2-dim array. I think it's okay enough. There is one more thing. Let's suppose i forked my parent process several times, and before that fork statement there was a table of 2 int's named...
  14. Replies
    9
    Views
    12,021

    So what i might do is making simple...

    So what i might do is making simple two-dimensional char array like char X[A][B] where A is the number of strings which i'm gonna have in it (10, so it's not a problem) and B is the length of each...
  15. Replies
    9
    Views
    12,021

    Shared memory and malloc!

    Hi,

    i have a structure named A. I use shmget and shmat to create shared memory first, then assign my object to it. After that i do some forks. So they heritage this id and pointer, which shmget...
  16. Replies
    4
    Views
    1,287

    I'd like to post it here but i'm worrying that...

    I'd like to post it here but i'm worrying that someone would get it too and i would be accussed of stealing not my work (which would be very unpleasant). I've tried to send it to you on private, but...
  17. Replies
    4
    Views
    1,287

    Thanks for your reply. Yes, i use subprocesses...

    Thanks for your reply.

    Yes, i use subprocesses to handle each client individually. That's the way they did it in classes so i did it to and i'd rather do it that way even if that may be not the...
  18. Replies
    4
    Views
    1,287

    Problem with named FIFO

    Hi there,

    i have to write simple tcp messanger on linux. It has to have some basic functionality - when connecting via telnet, it must react to basic commands as put, get and exit and so on and...
Results 1 to 18 of 18