JohnGreek

Members
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

100 Neutral

About JohnGreek

  • Rank
    Newbie
  1. Theory - ultimate AI, at atomic level

    In my very personal opinion trying to create the "Ultimate AI" is a waste of time. I don't mean that AI is a subject that should not be developed since it's at a great level already( like TOPIO). In order to make it more clear think of a simple thing. What humans have that computers don't? Maybe a lot of things but i'll stick to the subject. So a human has something called "thought" which it's quite easy to understand, but it cannot be abstracted with any kind of mathematical equation. You simply say "i want to go there" and there may be some obstacles in the way but you "know" how to bypass them without saying "i have to do this maneuver" or jump, it's done right away without any comparing or calculation. So AI i simply a way to simulate thought with mathematics and equations but real thought cannot be simulated that way. If you want a real example what i mean just test yourself by putting a simple problem to go somewhere but with obstacles on the way, what you do in order to go there? And see if you can put down that thought with mathematics. Although AI may be reach a level quite high enough, the "thinking with calculations" is not the real way of thinking so it's quite limited compared to human thought. Again this is my personal opinion and i'm open to ideas. - A programmer
  2. Actually the case is that when a packet that contains the data ex. "USER_REGISTER" it starts a new thread called RegisterThread which is responsible to handle the register operation, so if at the same time 2 users try to register, it will handle them at the same time. But this is supposed to be done in the future as well, since the server will handle many users at the same time in games. But you say it's a bad idea.. how i can handle 2 users try to register at the same time without blocking each other, or other operations at the same time? If you have any idea it could really help.. To answer your question i did make a small console and made 2 threads and guess what, it worked! That's why i'm so frustrated. I don't really see why it creates a problem because i get the error from the create_thread function on both libraries, not when a new socket is init, so something happens at that part. One thing that comes in my mind is that i use the same port to create all new sockets but i also added the REUSEADDR in the socket option. I hope you got an idea.
  3. [size="3"]Hello, i am programming a winsock server and client. It's (supposed to be) multithreaded but i' ve run to a very serious problem and spend quite some time but i still cannot handle it. Googled as well, still nothing. The problem is as follows: I have a function which runs all the time to recieve the packets, and when a packet is recieved it creates a new thread to process the data. But when i connect with a second client, the second thread fails to init and returns NULL. I have this problem with SDL [b]and [/b]pthreads. In SDL i get NULL from the thread and from pthread i get [EAGAIN] error which is "The system lacked the necessary resources to create another thread, or the system-imposed limit on the total number of threads in a process PTHREAD_THREADS_MAX would be exceeded." When i run this macro i get 2k+ THREADS_MAX, so i can create 2k threads normaly. It's not possible that i don't have resources since my machine is dual-core/2GB RAM. I' ve spend hours and hours without any result. One more thing when i made a test application to see if the thread is created and running, it actually worked, but in this one i need it' doesn' t. If you need code just tell me, although i doubt it' s error in my code, i checked quite many times and changed everything to very simple, and still.. Thanks in advance. [/size]