• Breaking News

    Monday, November 2, 2020

    Is “releases the mutexes in reverse order” required to make a program deadlock-free? Computer Science

    Is “releases the mutexes in reverse order” required to make a program deadlock-free? Computer Science


    Is “releases the mutexes in reverse order” required to make a program deadlock-free?

    Posted: 01 Nov 2020 06:45 PM PST

    Operating System Concepts says

    7.4.4 Circular Wait

    The fourth and final condition for deadlocks is the circular-wait condition. One way to ensure that this condition never holds is to impose a total ordering of all resource types and to require that each process requests resources in an increasing order of enumeration.

    Computers Systems: a Programmer's Perspective says

    Programs deadlock for many reasons, and preventing them is a difficult problem in general. However, when binary semaphores are used for mutual exclusion, as in Figure 12.44, then you can apply the following simple and effective rule to prevent deadlocks:

    Mutex lock ordering rule: Given a total ordering of all mutexes, a program is deadlock-free if each thread acquires its mutexes in order and releases them in reverse order.

    Is it correct that both describe the same deadlock-prevention method?

    If yes, in this deadlock-prevention method:

    • Is "releases mutexes in reverse order" required to make this deadlock-prevention method work? (It appears in the second book, but not in the first book.)

    • Does the order between releases of the mutexes matter to existence of deadlock? (For example, for two semaphores s and t, order P(s), P(t), V(t), V(s), and order P(s), P(t), V(s), V(t))

    Thanks.

    submitted by /u/timlee126
    [link] [comments]

    Django vs Node

    Posted: 02 Nov 2020 03:39 AM PST

    Which is better for social network graduation project Django or node we already choosed react for frontend? and why? Machine learning features may be added later.

    submitted by /u/Eslam-o_o-Ahmed
    [link] [comments]

    is there difference between releasing two semaphores in the same or reverse order as they are acquired?

    Posted: 02 Nov 2020 03:19 AM PST

    Generally, if two semaphores are acquired one after the other, is there difference between releasing them in the same order or the reverse order as they are acquired?

    In the following solution to the third readers-writers problem from http://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem#Third_readers%E2%80%93writers_problem,

    • in reader(), why are serviceQueue and rmutex released in the same order as they are acquired?
    • does it matter whether serviceQueue and rmutex are released in the same or reverse order as they are acquired?

    Code:

    int readcount; // init to 0; number of readers currently accessing resource // all semaphores initialised to 1 semaphore resource; // controls access (read/write) to the resource semaphore rmutex; // for syncing changes to shared variable readcount semaphore serviceQueue; // FAIRNESS: preserves ordering of requests (signaling must be FIFO) //READER reader() { <ENTRY Section> serviceQueue.P(); // wait in line to be serviced rmutex.P(); // request exclusive access to readcount readcount++; // update count of active readers if (readcount == 1) // if I am the first reader resource.P(); // request resource access for readers (writers blocked) serviceQueue.V(); // let next in line be serviced rmutex.V(); // release access to readcount <CRITICAL Section> //reading is performed <EXIT Section> rmutex.P(); // request exclusive access to readcount readcount--; // update count of active readers if (readcount == 0) // if there are no readers left resource.V(); // release resource access for all rmutex.V(); // release access to readcount } //WRITER writer() { <ENTRY Section> serviceQueue.P(); // wait in line to be serviced resource.P(); // request exclusive access to resource serviceQueue.V(); // let next in line be serviced <CRITICAL Section> // writing is performed <EXIT Section> resource.V(); // release resource access for next reader/writer } 
    submitted by /u/timlee126
    [link] [comments]

    What does the Google Quantum AI Lab do, as I've heard that Quantum AI is mostly just a buzzword?

    Posted: 01 Nov 2020 04:31 AM PST

    As far as I know they are also developing Quantum Computers, but I'm not sure what it has to do with AI. I believe Quantum AI might be algorithms which are optimized to run on QCs, but I'm not sure. I've also heard that Quantum AI isn't really an active field and more of a buzzword, is that true? What does Google do with Quantum AI then?

    submitted by /u/computer_man789
    [link] [comments]

    Looking to collaborate on software projects with other devs so I started /r/ProgrammingPals.

    Posted: 01 Nov 2020 10:30 PM PST

    Hey all, I've been writing software professionally and as a hobby for a few years now. A few months back I created /r/ProgrammingPals as a way to team up with other developers to build and ship software. I'm kinda surprised there isn't a much larger concerted effort to find devs to team up on software projects - whether open source or closed, for profit or for fun. After all, these machines have created a hyper-connected world of strangers so maybe we can use it as a way to meet more devs and collectively build stuff that wouldn't have been possible otherwise.

    On a more reflective note - it seems strange to me that a majority of the worlds collaboration is locked up in private organizations. It's not for a lack of want - I think there are plenty of us who want to connect and build useful software although we lack the tools/data to do it effectively. Maybe a good start is just doing it and seeing the flaws then building tools to correct the flaws so that collaborating with internet strangers gradually becomes more effective. If devs groups can spontaneously come together and build something that solves a problem for an organization, community, or larger group I think the effort will have been worth it.

    submitted by /u/Roybot93
    [link] [comments]

    CS workplace setup [Poll]

    Posted: 02 Nov 2020 01:38 AM PST

    Quite recently I got downvoted by the r/java community for suggesting to use at least two screens for software development.

    So now I would like to shine some working environment research light onto your screen setup.

    I would be happy if you comment on your workplace setup for CS, Development, Electrical Engineering or what ever trade you come from perspective.

    View Poll

    submitted by /u/pag07
    [link] [comments]

    From Google Robotics: State of the art in Robotic Manipulation

    Posted: 01 Nov 2020 10:45 PM PST

    ACM has published a substantiative article on teaching coding in schools

    Posted: 01 Nov 2020 09:47 PM PST

    Hello friends,

    ACM has published a substantiative article on teaching coding in schools. The article outlines challenges and opportunities, and presents a nice context for a discussion.

    Select quotes FTA:

    In our research, we have seen how coding becomes most motivating and meaningful for students when they have opportunities to create their own projects and express their own ideas.

    and

    In our research group, we have developed four guiding principles for supporting creative learning and computational fluency. We call these principles the Four Ps of Creative Learning: Projects, Passion, Peers, and Play.

    As a practicing high-school computer science teacher, I would like to invite this community to share their thoughts and opinions about this article and computational fluency in the K-12 space.

    Thank you.

    submitted by /u/hs_computer_science
    [link] [comments]

    Artificial intelligence in recommender systems

    Posted: 01 Nov 2020 10:06 AM PST

    Vulkan Compute webinar recording + sample transposition code

    Posted: 01 Nov 2020 11:14 AM PST

    Hello, I am the creator of VkFFT library. I was recently invited to be a speaker at the EUROfusion Webinar #5 about Vulkan Compute. I would like to share the recording of it with the community: https://www.youtube.com/watch?v=YD_QO5Ilz2U. I have discussed the following topics there:

    -Compute and memory-bound problems. Importance of proper memory management and why it is important to have coalesced global memory accesses and avoid shared memory bank conflicts.

    -VkFFT, Vulkan Spirit and memory layout optimizations implemented there

    -There was a coding session in the end where I showed a simple out-of-place transposition routine in Vulkan. It was launched on Nvidia GTX 1660Ti, Intel UHD 610 and AMD Radeon Vega RX 10 to illustrate the differences in bandwidth and memory coalescing of the different architectures. Full code with comments can be found here: https://github.com/DTolm/VulkanComputeSamples-Transposition

    Hope this can be interesting to people willing to try Vulkan for computations!

    P.S. I have added double and half precision support (with precision verification) to VkFFT and a choice to perform FFTs using lookup tables. VkFFT now also has a command line interface and it is possible to build cuFFT benchmark and launch it right after VkFFT one.

    submitted by /u/xdtolm
    [link] [comments]

    The Art of Computer Programming and the almighty math

    Posted: 01 Nov 2020 06:38 AM PST

    Hello,
    I've been suggested to read this book.
    Looked it up online on reddit, everybody says it's a must.
    Now that I've started reading it, I'm having a bad time with the math even at the early pages, like I'm reading it and I'm like "What is he talks about?".
    Has anyone encountered something similar? Any suggestions to how to solve this little problem?
    Thanks for reading!

    submitted by /u/Hamidashi
    [link] [comments]

    Need advice on getting a Master’s degree in CS

    Posted: 01 Nov 2020 03:44 PM PST

    I have a BFA in Advertising Arts in the Philippines and the education system at the tertiary level is very different here in the US.

    I am aware that both courses are not exactly interdisciplinary and I will need a lot of pre requisite I am wondering what are those pre requisite courses I need to take before I take my GRE and apply to a university?

    Would it be smarter/cheaper to take those pre req at a community college? Or are there some kind of program that tackles the entire master's degree with the pre req itself? Because from where I came from, the entire 2 years of taking a master's degree is focused on your graduate thesis.

    Any input would be very helpful since I am very unfamiliar with how the system works here. Thank you so much.

    submitted by /u/iixixiv
    [link] [comments]

    Classic critique of mathematics

    Posted: 01 Nov 2020 04:33 PM PST

    Maintaining CGPA above 3.8 in Compsci in University and College.

    Posted: 01 Nov 2020 12:43 PM PST

    I just want to ask that is anyone here had maintain a CGPA above 3.5 in their bachelors degree, and if yes how did you do it like how did you study in hours or per week?

    submitted by /u/cryfrychips
    [link] [comments]

    Could a third state in transistors used to delemit two bytes?

    Posted: 01 Nov 2020 05:08 AM PST

    For example, if we had the two bytes 11111111 and 00001111, they would be interpreted as 1111111100001111, right? Would it be possible to introduce a third state, which would be a delimiter? So 1111111100001111 would become 1111111121111, where 2 would be used to delimit the both.

    I am a noob and and just wondered if this were possible as that way more information could be transferred maybe (as the leading 0 wouldn't be "occupied")?

    submitted by /u/computer_man789
    [link] [comments]

    Would a Computer Scientist be able to create hardware/some device if they for example developed some theory and require it?

    Posted: 01 Nov 2020 04:12 AM PST

    For example, if a Computer Scientist discovers some theory that allows for faster CPUs, how would they create it? As far as I know, Computer Scientists are more concerned with software and theory (as said), so they probably wouldn't know how to create some hardware, like (electrical, computer, etc.) engineers would, right? So how would/could they do it, if they wanted to?

    submitted by /u/computer_man789
    [link] [comments]

    No comments:

    Post a Comment